|
1 /* $Id$ */ |
|
2 |
|
3 /** @file ai_town.hpp Everything to query towns */ |
|
4 |
|
5 #ifndef AI_TOWN_HPP |
|
6 #define AI_TOWN_HPP |
|
7 |
|
8 #include "ai_object.hpp" |
|
9 |
|
10 class AITown : public AIObject { |
|
11 public: |
|
12 /** |
|
13 * Gets the maximum town index; there are no valid towns with a higher index |
|
14 * @return the maximum town index |
|
15 * @post return >= 0 |
|
16 */ |
|
17 TownID GetMaxTownID(); |
|
18 |
|
19 /** |
|
20 * Gets the number of towns |
|
21 * @return the number of towns |
|
22 * @post return >= 0 |
|
23 */ |
|
24 int32 GetTownCount(); |
|
25 |
|
26 /** |
|
27 * Checks whether the given town index is valid |
|
28 * @param town_id the index to check |
|
29 * @return true if and only if the town is valid |
|
30 */ |
|
31 bool IsValidTown(TownID town_id); |
|
32 |
|
33 /** |
|
34 * Get the name of the town |
|
35 * @param town_id the town to get the name of |
|
36 * @pre this->IsValidTown(town) |
|
37 * @return the name of the town |
|
38 * @note the returned name must be freed |
|
39 */ |
|
40 char *GetName(TownID town_id); |
|
41 |
|
42 /** |
|
43 * Gets the number of inhabitants in the town |
|
44 * @param town_id the town to get the name of |
|
45 * @pre this->IsValidTown(town) |
|
46 * @return the number of inhabitants |
|
47 * @post return >= 0 |
|
48 */ |
|
49 int32 GetPopulation(TownID town_id); |
|
50 |
|
51 /** |
|
52 * Gets the location of inhabitants in the town |
|
53 * @param town_id the location of the town |
|
54 * @pre this->IsValidTown(town) |
|
55 * @return the number of inhabitants |
|
56 * @post return >= 0 |
|
57 */ |
|
58 TileIndex GetLocation(TownID town_id); |
|
59 }; |
|
60 |
|
61 #endif /* AI_TOWN_HPP */ |