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/depot.h | |
parent | 1367c9016149f3e750bf5cb2b0f7cbe0dbfaee1b (diff) | |
download | openttd-9488db56d4994cb653129e7d82973ae827537e05.tar.xz |
(svn r12745) -Codechange: a bit of naming conventions, introduce Is*DepotTile()
Diffstat (limited to 'src/depot.h')
-rw-r--r-- | src/depot.h | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/depot.h b/src/depot.h index 42bd84b54..28c5275c9 100644 --- a/src/depot.h +++ b/src/depot.h @@ -36,23 +36,20 @@ void ShowDepotWindow(TileIndex tile, VehicleType type); #define FOR_ALL_DEPOTS(d) FOR_ALL_DEPOTS_FROM(d, 0) /** - * Check if a tile is a depot of the given type. + * Check if a tile is a depot and it is a depot of the given type. */ -static inline bool IsTileDepotType(TileIndex tile, TransportType type) +static inline bool IsDepotTypeTile(TileIndex tile, TransportType type) { switch (type) { + default: NOT_REACHED(); case TRANSPORT_RAIL: - return IsTileType(tile, MP_RAILWAY) && GetRailTileType(tile) == RAIL_TILE_DEPOT; + return IsRailDepotTile(tile); case TRANSPORT_ROAD: return IsRoadDepotTile(tile); case TRANSPORT_WATER: - return IsTileType(tile, MP_WATER) && GetWaterTileType(tile) == WATER_TILE_DEPOT; - - default: - NOT_REACHED(); - return false; + return IsShipDepotTile(tile); } } @@ -63,13 +60,7 @@ static inline bool IsTileDepotType(TileIndex tile, TransportType type) */ static inline bool IsDepotTile(TileIndex tile) { - switch (GetTileType(tile)) { - case MP_ROAD: return IsRoadDepot(tile); - case MP_WATER: return GetWaterTileType(tile) == WATER_TILE_DEPOT; - case MP_RAILWAY: return GetRailTileType(tile) == RAIL_TILE_DEPOT; - case MP_STATION: return IsHangar(tile); - default: return false; - } + return IsRailDepotTile(tile) || IsRoadDepotTile(tile) || IsShipDepotTile(tile) || IsHangarTile(tile); } /** |