10249
|
1 |
/* $Id$ */
|
|
2 |
|
|
3 |
/** @file depot_map.h Map related accessors for depots. */
|
|
4 |
|
|
5 |
#ifndef DEPOT_MAP_H
|
|
6 |
#define DEPOT_MAP_H
|
|
7 |
|
|
8 |
#include "road_map.h"
|
|
9 |
#include "rail_map.h"
|
|
10 |
#include "water_map.h"
|
|
11 |
#include "station_map.h"
|
|
12 |
|
|
13 |
/**
|
|
14 |
* Check if a tile is a depot and it is a depot of the given type.
|
|
15 |
*/
|
|
16 |
static inline bool IsDepotTypeTile(TileIndex tile, TransportType type)
|
|
17 |
{
|
|
18 |
switch (type) {
|
|
19 |
default: NOT_REACHED();
|
|
20 |
case TRANSPORT_RAIL:
|
|
21 |
return IsRailDepotTile(tile);
|
|
22 |
|
|
23 |
case TRANSPORT_ROAD:
|
|
24 |
return IsRoadDepotTile(tile);
|
|
25 |
|
|
26 |
case TRANSPORT_WATER:
|
|
27 |
return IsShipDepotTile(tile);
|
|
28 |
}
|
|
29 |
}
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Is the given tile a tile with a depot on it?
|
|
33 |
* @param tile the tile to check
|
|
34 |
* @return true if and only if there is a depot on the tile.
|
|
35 |
*/
|
|
36 |
static inline bool IsDepotTile(TileIndex tile)
|
|
37 |
{
|
|
38 |
return IsRailDepotTile(tile) || IsRoadDepotTile(tile) || IsShipDepotTile(tile) || IsHangarTile(tile);
|
|
39 |
}
|
|
40 |
|
|
41 |
#endif /* DEPOT_MAP_H */
|