diff options
author | smatz <smatz@openttd.org> | 2008-04-17 00:44:20 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-04-17 00:44:20 +0000 |
commit | 9488db56d4994cb653129e7d82973ae827537e05 (patch) | |
tree | 5f5827bd541cf5d637cd23faa64aea957404ca89 /src/rail_map.h | |
parent | 1367c9016149f3e750bf5cb2b0f7cbe0dbfaee1b (diff) | |
download | openttd-9488db56d4994cb653129e7d82973ae827537e05.tar.xz |
(svn r12745) -Codechange: a bit of naming conventions, introduce Is*DepotTile()
Diffstat (limited to 'src/rail_map.h')
-rw-r--r-- | src/rail_map.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/rail_map.h b/src/rail_map.h index 008fb39ef..2789b419a 100644 --- a/src/rail_map.h +++ b/src/rail_map.h @@ -72,7 +72,18 @@ static inline void SetHasSignals(TileIndex tile, bool signals) } /** - * Is this tile a rail depot? + * Is this rail tile a rail waypoint? + * @param t the tile to get the information from + * @pre IsTileType(t, MP_RAILWAY) + * @return true if and only if the tile is a rail waypoint + */ +static inline bool IsRailWaypoint(TileIndex t) +{ + return GetRailTileType(t) == RAIL_TILE_WAYPOINT; +} + +/** + * Is this rail tile a rail depot? * @param t the tile to get the information from * @pre IsTileType(t, MP_RAILWAY) * @return true if and only if the tile is a rail depot @@ -83,17 +94,16 @@ static inline bool IsRailDepot(TileIndex t) } /** - * Is this tile a rail waypoint? + * Is this tile rail tile and a rail depot? * @param t the tile to get the information from * @pre IsTileType(t, MP_RAILWAY) - * @return true if and only if the tile is a rail waypoint + * @return true if and only if the tile is a rail depot */ -static inline bool IsRailWaypoint(TileIndex t) +static inline bool IsRailDepotTile(TileIndex t) { - return GetRailTileType(t) == RAIL_TILE_WAYPOINT; + return IsTileType(t, MP_RAILWAY) && IsRailDepot(t); } - /** * Gets the rail type of the given tile * @param t the tile to get the rail type from |