equal
deleted
inserted
replaced
6 /** @file depot.h Header files for depots (not hangars) |
6 /** @file depot.h Header files for depots (not hangars) |
7 * @see depot.c */ |
7 * @see depot.c */ |
8 |
8 |
9 #include "direction.h" |
9 #include "direction.h" |
10 #include "pool.h" |
10 #include "pool.h" |
11 #include "rail_map.h" |
|
12 #include "road_map.h" |
|
13 #include "tile.h" |
11 #include "tile.h" |
14 #include "variables.h" |
12 #include "variables.h" |
15 #include "water_map.h" |
|
16 |
13 |
17 struct Depot { |
14 struct Depot { |
18 TileIndex xy; |
15 TileIndex xy; |
19 TownID town_index; |
16 TownID town_index; |
20 StationID index; |
17 StationID index; |
90 assert(0); |
87 assert(0); |
91 return false; |
88 return false; |
92 } |
89 } |
93 } |
90 } |
94 |
91 |
95 /** |
|
96 * Returns the direction the exit of the depot on the given tile is facing. |
|
97 */ |
|
98 static inline DiagDirection GetDepotDirection(TileIndex tile, TransportType type) |
|
99 { |
|
100 assert(IsTileDepotType(tile, type)); |
|
101 |
|
102 switch (type) { |
|
103 case TRANSPORT_RAIL: return GetRailDepotDirection(tile); |
|
104 case TRANSPORT_ROAD: return GetRoadDepotDirection(tile); |
|
105 case TRANSPORT_WATER: return GetShipDepotDirection(tile); |
|
106 default: return INVALID_DIAGDIR; /* Not reached */ |
|
107 } |
|
108 } |
|
109 |
92 |
110 /** |
93 /** |
111 Find out if the slope of the tile is suitable to build a depot of given direction |
94 Find out if the slope of the tile is suitable to build a depot of given direction |
112 @param direction The direction in which the depot's exit points. Starts with 0 as NE and goes Clockwise |
95 @param direction The direction in which the depot's exit points. Starts with 0 as NE and goes Clockwise |
113 @param tileh The slope of the tile in question |
96 @param tileh The slope of the tile in question |