summaryrefslogtreecommitdiff
path: root/src/newgrf_commons.h
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-06-09 02:05:51 +0000
committerbelugas <belugas@openttd.org>2007-06-09 02:05:51 +0000
commit9a4a911bdecd3287cc2e28dad93ce56c13a87ec4 (patch)
tree9ffd98b22fce3fd13fee357910ac42412626fb6d /src/newgrf_commons.h
parent142f2aba15a3b37ff3aa9955c560deba6cd1572d (diff)
downloadopenttd-9a4a911bdecd3287cc2e28dad93ce56c13a87ec4.tar.xz
(svn r10074) -Add: Addition of IndustryOverrideManager as well as the basic (and unfinished) support for callbacks for industries
Diffstat (limited to 'src/newgrf_commons.h')
-rw-r--r--src/newgrf_commons.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h
index a7c00e65c..f45594f14 100644
--- a/src/newgrf_commons.h
+++ b/src/newgrf_commons.h
@@ -35,7 +35,6 @@ protected:
uint16 invalid_ID; ///< ID used to dected invalid entities;
- virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
public:
EntityIDMapping *mapping_ID; ///< mapping of ids from grf files. Public out of convenience
@@ -46,6 +45,7 @@ public:
void ResetMapping();
void Add(uint8 local_id, uint entity_type);
+ virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
uint16 GetSubstituteID(byte entity_id);
uint16 GetID(uint8 grf_local_id, uint32 grfid);
@@ -59,12 +59,25 @@ struct HouseSpec;
class HouseOverrideManager : public OverrideManagerBase
{
public:
- HouseOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) : OverrideManagerBase(offset, maximum, invalid) {};
+ HouseOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
+ OverrideManagerBase(offset, maximum, invalid) {};
void SetEntitySpec(const HouseSpec *hs);
};
+struct IndustrySpec;
+class IndustryOverrideManager : public OverrideManagerBase
+{
+ public:
+ IndustryOverrideManager(uint16 offset, uint16 maximum, uint16 invalid) :
+ OverrideManagerBase(offset, maximum, invalid) {};
+
+ virtual uint16 AddEntityID(byte grf_local_id, uint32 grfid, byte substitute_id);
+ void SetEntitySpec(const IndustrySpec *inds);
+};
+
extern HouseOverrideManager _house_mngr;
+extern IndustryOverrideManager _industry_mngr;
uint32 GetTerrainType(TileIndex tile);
TileIndex GetNearbyTile(byte parameter, TileIndex tile);