src/newgrf_commons.h
branchNewGRF_ports
changeset 6870 ca3fd1fbe311
parent 6743 cabfaa4a0295
child 6871 5a9dc001e1ad
equal deleted inserted replaced
6869:76282d3b748d 6870:ca3fd1fbe311
    31 
    31 
    32 	uint16 max_offset;       ///< what is the length of the original entity's array of specs
    32 	uint16 max_offset;       ///< what is the length of the original entity's array of specs
    33 	uint16 max_new_entities; ///< what is the amount of entities, old and new summed
    33 	uint16 max_new_entities; ///< what is the amount of entities, old and new summed
    34 
    34 
    35 	uint16 invalid_ID;       ///< ID used to dected invalid entities;
    35 	uint16 invalid_ID;       ///< ID used to dected invalid entities;
       
    36 	virtual bool CheckValidNewID(uint16 testid) { return true; }
    36 
    37 
    37 public:
    38 public:
    38 	EntityIDMapping *mapping_ID; ///< mapping of ids from grf files.  Public out of convenience
    39 	EntityIDMapping *mapping_ID; ///< mapping of ids from grf files.  Public out of convenience
    39 
    40 
    40 	OverrideManagerBase(uint16 offset, uint16 maximum, uint16 invalid);
    41 	OverrideManagerBase(uint16 offset, uint16 maximum, uint16 invalid);
    68 public:
    69 public:
    69 	IndustryOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
    70 	IndustryOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
    70 			OverrideManagerBase(offset, maximum, invalid) {}
    71 			OverrideManagerBase(offset, maximum, invalid) {}
    71 
    72 
    72 	virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
    73 	virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
    73 	void SetEntitySpec(const IndustrySpec *inds);
    74 	void SetEntitySpec(IndustrySpec *inds);
    74 };
    75 };
    75 
    76 
    76 
    77 
    77 struct IndustryTileSpec;
    78 struct IndustryTileSpec;
    78 class IndustryTileOverrideManager : public OverrideManagerBase {
    79 class IndustryTileOverrideManager : public OverrideManagerBase {
       
    80 protected:
       
    81 	virtual bool CheckValidNewID(uint16 testid) { return testid != 0xFF; }
    79 public:
    82 public:
    80 	IndustryTileOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
    83 	IndustryTileOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
    81 			OverrideManagerBase(offset, maximum, invalid) {}
    84 			OverrideManagerBase(offset, maximum, invalid) {}
    82 
    85 
    83 	void SetEntitySpec(const IndustryTileSpec *indts);
    86 	void SetEntitySpec(const IndustryTileSpec *indts);