|
1 /* $Id$ */ |
|
2 |
|
3 /** @file ai_airport.hpp Everything to query and build airports */ |
|
4 |
|
5 #ifndef AI_AIRPORT_HPP |
|
6 #define AI_AIRPORT_HPP |
|
7 |
|
8 #include "ai_object.hpp" |
|
9 |
|
10 /** |
|
11 * Class that handles all airport related functions. |
|
12 */ |
|
13 class AIAirport : public AIObject { |
|
14 public: |
|
15 enum AirportType { |
|
16 AT_SMALL = 0, |
|
17 AT_LARGE = 1, |
|
18 AT_HELIPORT = 2, |
|
19 AT_METROPOLITAN = 3, |
|
20 AT_INTERNATIONAL = 4, |
|
21 AT_COMMUTER = 5, |
|
22 AT_HELIDEPOT = 6, |
|
23 AT_INTERCON = 7, |
|
24 AT_HELISTATION = 8, |
|
25 }; |
|
26 |
|
27 /** |
|
28 * The name of the class, needed by several sub-processes. |
|
29 */ |
|
30 static const char *GetClassName() { return "AIAirport"; } |
|
31 |
|
32 /** |
|
33 * Checks whether the given tile is actually a tile with a hangar. |
|
34 * @param tile the tile to check. |
|
35 * @pre tile is always positive and smaller than AIMap::GetMapSize(). |
|
36 * @return true if and only if the tile has a hangar. |
|
37 */ |
|
38 bool IsHangarTile(TileIndex tile); |
|
39 |
|
40 /** |
|
41 * Checks whether the given tile is actually a tile with a airport. |
|
42 * @param tile the tile to check. |
|
43 * @pre tile is always positive and smaller than AIMap::GetMapSize(). |
|
44 * @return true if and only if the tile has a airport. |
|
45 */ |
|
46 bool IsAirportTile(TileIndex tile); |
|
47 |
|
48 /** |
|
49 * Check if a certain airport type is already available. |
|
50 * @param type the type of airport to check. |
|
51 */ |
|
52 bool AiportAvailable(AirportType type); |
|
53 |
|
54 /** |
|
55 * Builds a airport with tile at the topleft corner. |
|
56 * @param tile the topleft corner of the airport. |
|
57 * @param type the type of airport to build. |
|
58 * @pre tile is always positive and smaller than AIMap::GetMapSize(). |
|
59 * @return whether the airport has been/can be build or not. |
|
60 */ |
|
61 bool BuildAirport(TileIndex tile, AirportType type); |
|
62 |
|
63 /** |
|
64 * Removes a airport. |
|
65 * @param tile any tile of the airport. |
|
66 * @pre tile is always positive and smaller than AIMap::GetMapSize(). |
|
67 * @return whether the airport has been/can be removed or not. |
|
68 */ |
|
69 bool RemoveAirport(TileIndex tile); |
|
70 |
|
71 /** |
|
72 * Get the first hanger tile of the airport. |
|
73 * @param tile any tile of the airport. |
|
74 * @pre tile is always positive and smaller than AIMap::GetMapSize(). |
|
75 * @return the first hanger tile of the airport. |
|
76 */ |
|
77 TileIndex GetHangarOfAirport(TileIndex tile); |
|
78 }; |
|
79 |
|
80 #endif /* AI_AIRPORT_HPP */ |