From 9488db56d4994cb653129e7d82973ae827537e05 Mon Sep 17 00:00:00 2001 From: smatz Date: Thu, 17 Apr 2008 00:44:20 +0000 Subject: (svn r12745) -Codechange: a bit of naming conventions, introduce Is*DepotTile() --- src/rail_map.h | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/rail_map.h') 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 -- cgit v1.2.3-54-g00ecf