equal
deleted
inserted
replaced
1 #ifndef STATION_H |
1 #ifndef STATION_H |
2 #define STATION_H |
2 #define STATION_H |
3 |
3 |
4 #include "sprite.h" |
4 #include "sprite.h" |
|
5 #include "tile.h" |
5 #include "vehicle.h" |
6 #include "vehicle.h" |
6 |
7 |
7 typedef struct GoodsEntry { |
8 typedef struct GoodsEntry { |
8 uint16 waiting_acceptance; |
9 uint16 waiting_acceptance; |
9 byte days_since_pickup; |
10 byte days_since_pickup; |
222 inline int GetRoadStopType(TileIndex tile); |
223 inline int GetRoadStopType(TileIndex tile); |
223 uint GetNumRoadStops(const Station *st, RoadStopType type); |
224 uint GetNumRoadStops(const Station *st, RoadStopType type); |
224 RoadStop * GetPrimaryRoadStop(const Station *st, RoadStopType type); |
225 RoadStop * GetPrimaryRoadStop(const Station *st, RoadStopType type); |
225 RoadStop * GetFirstFreeRoadStop( void ); |
226 RoadStop * GetFirstFreeRoadStop( void ); |
226 |
227 |
|
228 static inline bool IsTrainStationTile(uint tile) { |
|
229 return IsTileType(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 0, 8); |
|
230 } |
|
231 |
|
232 static inline bool IsRoadStationTile(uint tile) { |
|
233 return IsTileType(tile, MP_STATION) && IS_BYTE_INSIDE(_map5[tile], 0x43, 0x4B); |
|
234 } |
|
235 |
|
236 /* Get's the direction the station exit points towards. Ie, returns 0 for a |
|
237 * station with the exit NE. */ |
|
238 static inline byte GetRoadStationDir(uint tile) { |
|
239 assert(IsRoadStationTile(tile)); |
|
240 return (_map5[tile] - 0x43) & 3; |
|
241 } |
|
242 |
227 #endif /* STATION_H */ |
243 #endif /* STATION_H */ |