(svn r16938) -Codechange: introduce helper function to tell whether a tile is either a rail station or rail waypoint tile

This commit is contained in:
rubidium
2009-07-24 11:15:11 +00:00
parent 36ebb4fe58
commit 00a9b2fd3d
12 changed files with 36 additions and 14 deletions

View File

@@ -109,6 +109,28 @@ static inline bool IsRailWaypointTile(TileIndex t)
return IsTileType(t, MP_STATION) && IsRailWaypoint(t);
}
/**
* Has this station tile a rail? In other words, is this station
* tile a rail station or rail waypoint?
* @param t the tile to check
* @pre IsTileType(t, MP_STATION)
* @return true if and only if the tile has rail
*/
static inline bool HasStationRail(TileIndex t)
{
return IsRailwayStation(t) || IsRailWaypoint(t);
}
/**
* Has this station tile a rail? In other words, is this station
* tile a rail station or rail waypoint?
* @param t the tile to check
* @return true if and only if the tile is a station tile and has rail
*/
static inline bool HasStationTileRail(TileIndex t)
{
return IsTileType(t, MP_STATION) && HasStationRail(t);
}
static inline bool IsAirport(TileIndex t)
{