diff options
author | rubidium <rubidium@openttd.org> | 2010-08-07 22:07:07 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-08-07 22:07:07 +0000 |
commit | edbadde301d04264110b1b923ba80af367f6651c (patch) | |
tree | e9f8998e89b9811d9bc0febd58272339a63951c9 /src/newgrf_station.h | |
parent | cb4ab6a23158163e848ab2b5887d1eb449b86a4c (diff) | |
download | openttd-edbadde301d04264110b1b923ba80af367f6651c.tar.xz |
(svn r20406) -Codechange: make StationClass use the new generic class
Diffstat (limited to 'src/newgrf_station.h')
-rw-r--r-- | src/newgrf_station.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/src/newgrf_station.h b/src/newgrf_station.h index 1c49dde18..523f72f0c 100644 --- a/src/newgrf_station.h +++ b/src/newgrf_station.h @@ -13,11 +13,11 @@ #define NEWGRF_STATION_H #include "newgrf_callbacks.h" +#include "newgrf_class.h" #include "newgrf_commons.h" #include "sprite.h" #include "direction_type.h" #include "cargo_type.h" -#include "strings_type.h" #include "station_type.h" #include "rail_type.h" @@ -108,29 +108,11 @@ struct StationSpec { const struct SpriteGroup *spritegroup[NUM_CARGO + 3]; }; -/** - * Struct containing information relating to station classes. - */ -struct StationClass { - uint32 id; ///< ID of this class, e.g. 'DFLT', 'WAYP', etc. - StringID name; ///< Name of this class. - uint stations; ///< Number of stations in this class. - StationSpec **spec; ///< Array of station specifications. -}; +/** Struct containing information relating to station classes. */ +typedef NewGRFClass<StationSpec, StationClassID, STAT_CLASS_MAX> StationClass; -void ResetStationClasses(); -StationClassID AllocateStationClass(uint32 cls); -void SetStationClassName(StationClassID sclass, StringID name); -StringID GetStationClassName(StationClassID sclass); const StationSpec *GetStationSpec(TileIndex t); -uint GetNumStationClasses(); -uint GetNumCustomStations(StationClassID sclass); - -void SetCustomStationSpec(StationSpec *statspec); -const StationSpec *GetCustomStationSpec(StationClassID sclass, uint station); -const StationSpec *GetCustomStationSpecByGrf(uint32 grfid, byte localidx, int *index); - /* Evaluate a tile's position within a station, and return the result a bitstuffed format. */ uint32 GetPlatformInfo(Axis axis, byte tile, int platforms, int length, int x, int y, bool centred); |