author | rubidium |
Sun, 08 Jun 2008 19:35:16 +0000 | |
branch | noai |
changeset 10869 | 4fdb11e1b599 |
parent 10865 | c4b3ddd2e9da |
permissions | -rw-r--r-- |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
1 |
/* $Id$ */ |
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
2 |
|
9829
80fbe02a4184
(svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents:
9814
diff
changeset
|
3 |
/** @file ai_town.hpp Everything to query towns. */ |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
4 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
5 |
#ifndef AI_TOWN_HPP |
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
6 |
#define AI_TOWN_HPP |
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
7 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
8 |
#include "ai_object.hpp" |
10859
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
9 |
#include "ai_company.hpp" |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
10 |
|
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9427
diff
changeset
|
11 |
/** |
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9427
diff
changeset
|
12 |
* Class that handles all town related functions. |
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9427
diff
changeset
|
13 |
*/ |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
14 |
class AITown : public AIObject { |
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
15 |
public: |
9529
5f26f4bc574b
(svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents:
9526
diff
changeset
|
16 |
static const char *GetClassName() { return "AITown"; } |
5f26f4bc574b
(svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents:
9526
diff
changeset
|
17 |
|
5f26f4bc574b
(svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents:
9526
diff
changeset
|
18 |
/** |
10859
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
19 |
* Actions that one can perform on a town. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
20 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
21 |
enum TownAction { |
10865
c4b3ddd2e9da
(svn r13416) [NoAI] -Fix: make doxygen happy again
truebrain
parents:
10859
diff
changeset
|
22 |
/* Values are important, as they represent the internal state of the game. */ |
c4b3ddd2e9da
(svn r13416) [NoAI] -Fix: make doxygen happy again
truebrain
parents:
10859
diff
changeset
|
23 |
|
10859
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
24 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
25 |
* The cargo ratings temporary gains 25% of rating (in |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
26 |
* absolute percentage, so 10% becomes 35%, with a max of 99%) |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
27 |
* for all stations within 10 tiles. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
28 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
29 |
TOWN_ACTION_ADVERTISE_SMALL = 0, |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
30 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
31 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
32 |
* The cargo ratings temporary gains 44% of rating (in |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
33 |
* absolute percentage, so 10% becomes 54%, with a max of 99%) |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
34 |
* for all stations within 15 tiles. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
35 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
36 |
TOWN_ACTION_ADVERTISE_MEDIUM = 1, |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
37 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
38 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
39 |
* The cargo ratings temporary gains 63% of rating (in |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
40 |
* absolute percentage, so 10% becomes 73%, with a max of 99%) |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
41 |
* for all stations within 20 tiles. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
42 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
43 |
TOWN_ACTION_ADVERTISE_LARGE = 2, |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
44 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
45 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
46 |
* Rebuild the roads of this town for 6 months. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
47 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
48 |
TOWN_ACTION_ROAD_REBUILD = 3, |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
49 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
50 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
51 |
* Build a statue in this town. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
52 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
53 |
TOWN_ACTION_BUILD_STATUE = 4, |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
54 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
55 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
56 |
* Fund the creation of extra buildings for 3 months. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
57 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
58 |
TOWN_ACTION_FUND_BUILDINGS = 5, |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
59 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
60 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
61 |
* Buy exclusive rights for this town for 12 months. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
62 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
63 |
TOWN_ACTION_BUY_RIGHTS = 6, |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
64 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
65 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
66 |
* Bribe the town in order to get a higher rating. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
67 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
68 |
TOWN_ACTION_BRIBE = 7, |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
69 |
}; |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
70 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
71 |
/** |
10869
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
72 |
* Different ratings one could have in a town. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
73 |
*/ |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
74 |
enum TownRating { |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
75 |
TOWN_RATING_NONE, ///< The company got no rating in the town. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
76 |
TOWN_RATING_APPALLING, ///< The company got an appalling rating in the town . |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
77 |
TOWN_RATING_VERY_POOR, ///< The company got an very poor rating in the town. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
78 |
TOWN_RATING_POOR, ///< The company got an poor rating in the town. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
79 |
TOWN_RATING_MEDIOCRE, ///< The company got an mediocre rating in the town. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
80 |
TOWN_RATING_GOOD, ///< The company got an good rating in the town. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
81 |
TOWN_RATING_VERY_GOOD, ///< The company got an very good rating in the town. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
82 |
TOWN_RATING_EXCELLENT, ///< The company got an excellent rating in the town. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
83 |
TOWN_RATING_OUTSTANDING, ///< The company got an outstanding rating in the town. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
84 |
INVALID_TOWN_RATING = -1, ///< The town rating for invalid towns/companies. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
85 |
}; |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
86 |
|
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
87 |
/** |
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9427
diff
changeset
|
88 |
* Gets the maximum town index; there are no valid towns with a higher index. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
89 |
* @return The maximum town index. |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
90 |
* @post Return value is always non-negative. |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
91 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9723
diff
changeset
|
92 |
static TownID GetMaxTownID(); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
93 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
94 |
/** |
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9427
diff
changeset
|
95 |
* Gets the number of towns. This is different than GetMaxTownID() |
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9427
diff
changeset
|
96 |
* because of the way OpenTTD works internally. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
97 |
* @return The number of towns. |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
98 |
* @post Return value is always non-negative. |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
99 |
*/ |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9723
diff
changeset
|
100 |
static int32 GetTownCount(); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
101 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
102 |
/** |
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9427
diff
changeset
|
103 |
* Checks whether the given town index is valid. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
104 |
* @param town_id The index to check. |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
105 |
* @return True if and only if the town is valid. |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
106 |
*/ |
9497
f6678533ccba
(svn r9369) [NoAI] -Codechange: make some IsValidXXX() function static, so they can be used by the other classes without the need for an instance.
rubidium
parents:
9448
diff
changeset
|
107 |
static bool IsValidTown(TownID town_id); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
108 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
109 |
/** |
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9427
diff
changeset
|
110 |
* Get the name of the town. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
111 |
* @param town_id The town to get the name of. |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
112 |
* @pre IsValidTown(town_id). |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
113 |
* @return The name of the town. |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
114 |
*/ |
9582
40f54a61bb17
(svn r9606) [NoAI] -Fix: make GetXXX in AITown static, so we can use it without AITown instance
truelight
parents:
9541
diff
changeset
|
115 |
static char *GetName(TownID town_id); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
116 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
117 |
/** |
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9427
diff
changeset
|
118 |
* Gets the number of inhabitants in the town. |
10840
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
119 |
* @param town_id The town to get the population of. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
120 |
* @pre IsValidTown(town_id). |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
121 |
* @return The number of inhabitants. |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
122 |
* @post Return value is always non-negative. |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
123 |
*/ |
9582
40f54a61bb17
(svn r9606) [NoAI] -Fix: make GetXXX in AITown static, so we can use it without AITown instance
truelight
parents:
9541
diff
changeset
|
124 |
static int32 GetPopulation(TownID town_id); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
125 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
126 |
/** |
10840
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
127 |
* Gets the number of houses in the town. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
128 |
* @param town_id The town to get the number of houses of. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
129 |
* @pre IsValidTown(town_id). |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
130 |
* @return The number of houses. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
131 |
* @post Return value is always non-negative. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
132 |
*/ |
10844
affb2821fb9f
(svn r13395) [NoAI] -Fix [API CHANGE]: Rename AIOrder::GetNumberOfORders to AIOrder::GetOrderCount
truebrain
parents:
10841
diff
changeset
|
133 |
static int32 GetHouseCount(TownID town_id); |
10840
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
134 |
|
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
135 |
/** |
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9427
diff
changeset
|
136 |
* Gets the location of the town. |
10841
a8942f5f7e3b
(svn r13392) [NoAI] -Fix: comment fix in AITown::GetLocation
truebrain
parents:
10840
diff
changeset
|
137 |
* @param town_id The town to get the location of. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
138 |
* @pre IsValidTown(town_id). |
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
139 |
* @return The location of the town. |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
140 |
*/ |
9582
40f54a61bb17
(svn r9606) [NoAI] -Fix: make GetXXX in AITown static, so we can use it without AITown instance
truelight
parents:
9541
diff
changeset
|
141 |
static TileIndex GetLocation(TownID town_id); |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
142 |
|
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
143 |
/** |
10840
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
144 |
* Get the total last month's production of the given cargo at a town. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
145 |
* @param town_id The index of the town. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
146 |
* @param cargo_id The index of the cargo. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
147 |
* @pre IsValidTown(town_id). |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
148 |
* @pre AICargo::IsValidCargo(cargo_id). |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
149 |
* @pre AICargo::GetTownEffect(cargo_id) == TE_PASSENGERS || AICargo::GetTownEffect(cargo_id) == TE_MAIL. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
150 |
* @return The last month's production of the given cargo for this town. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
151 |
* @post Return value is always non-negative. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
152 |
*/ |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
153 |
static int32 GetLastMonthProduction(TownID town_id, CargoID cargo_id); |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
154 |
|
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
155 |
/** |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
156 |
* Get the total amount of cargo transported from a town last month. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
157 |
* @param town_id The index of the industry. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
158 |
* @param cargo_id The index of the cargo. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
159 |
* @pre IsValidTown(town_id). |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
160 |
* @pre AICargo::IsValidCargo(cargo_id). |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
161 |
* @pre AICargo::GetTownEffect(cargo_id) == TE_PASSENGERS || AICargo::GetTownEffect(cargo_id) == TE_MAIL. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
162 |
* @return The amount of given cargo transported from this town last month. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
163 |
* @post Return value is always non-negative. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
164 |
*/ |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
165 |
static int32 GetLastMonthTransported(TownID town_id, CargoID cargo_id); |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
166 |
|
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
167 |
/** |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
168 |
* Get the maximum production of the given cargo at a town. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
169 |
* @param town_id The index of the town. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
170 |
* @param cargo_id The index of the cargo. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
171 |
* @pre IsValidTown(town_id). |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
172 |
* @pre AICargo::IsValidCargo(cargo_id). |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
173 |
* @pre AICargo::GetTownEffect(cargo_id) == TE_PASSENGERS || AICargo::GetTownEffect(cargo_id) == TE_MAIL. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
174 |
* @return The maximum production of the given cargo for this town. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
175 |
* @post Return value is always non-negative. |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
176 |
*/ |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
177 |
static int32 GetMaxProduction(TownID town_id, CargoID cargo_id); |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
178 |
|
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
179 |
/** |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
180 |
* Get the manhattan distance from the tile to the AITown::GetLocation() |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
181 |
* of the town. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
182 |
* @param town_id The town to get the distance to. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
183 |
* @param tile The tile to get the distance to. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
184 |
* @pre IsValidTown(town_id). |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
185 |
* @return The distance between town and tile. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
186 |
*/ |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
187 |
static int32 GetDistanceManhattanToTile(TownID town_id, TileIndex tile); |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
188 |
|
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
189 |
/** |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
190 |
* Get the square distance from the tile to the AITown::GetLocation() |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
191 |
* of the town. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
192 |
* @param town_id The town to get the distance to. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
193 |
* @param tile The tile to get the distance to. |
9838
0839682a601b
(svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents:
9829
diff
changeset
|
194 |
* @pre IsValidTown(town_id). |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
195 |
* @return The distance between town and tile. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
196 |
*/ |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
197 |
static int32 GetDistanceSquareToTile(TownID town_id, TileIndex tile); |
10360
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
198 |
|
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
199 |
/** |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
200 |
* Find out if this tile is within the rating influence of a town. |
10361
4cdffd48480f
(svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents:
10360
diff
changeset
|
201 |
* Stations on this tile influence the rating of the town. |
10360
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
202 |
* @param town_id The town to check. |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
203 |
* @param tile The tile to check. |
10859
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
204 |
* @pre IsValidTown(town_id). |
10360
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
205 |
* @return True if the tile is within the rating influence of the town. |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
206 |
*/ |
10361
4cdffd48480f
(svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents:
10360
diff
changeset
|
207 |
static bool IsWithinTownInfluence(TownID town_id, TileIndex tile); |
10859
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
208 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
209 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
210 |
* Find out if this town has a statue for the current player. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
211 |
* @param town_id The town to check. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
212 |
* @pre IsValidTown(town_id). |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
213 |
* @return True if the town has a statue. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
214 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
215 |
static bool HasStatue(TownID town_id); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
216 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
217 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
218 |
* Find out how long the town is undergoing road reconstructions. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
219 |
* @param town_id The town to check. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
220 |
* @pre IsValidTown(town_id). |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
221 |
* @return The number of months the road reworks are still going to take. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
222 |
* The value 0 means that there are currently no road reworks. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
223 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
224 |
static int GetRoadReworkDuration(TownID town_id); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
225 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
226 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
227 |
* Find out which company currently has the exclusive rights of this town. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
228 |
* @param town_id The town to check. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
229 |
* @pre IsValidTown(town_id). |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
230 |
* @return The company that has the exclusive rights. The value |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
231 |
* AICompany::INVALID_COMPANY means that there are currently no |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
232 |
* exclusive rights given out to anyone. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
233 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
234 |
static AICompany::CompanyID GetExclusiveRightsPlayer(TownID town_id); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
235 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
236 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
237 |
* Find out how long the town is under influence of the exclusive rights. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
238 |
* @param town_id The town to check. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
239 |
* @pre IsValidTown(town_id). |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
240 |
* @return The number of months the exclusive rights hold. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
241 |
* The value 0 means that there are currently no exclusive rights |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
242 |
* given out to anyone. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
243 |
*/ |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
244 |
static int32 GetExclusiveRightsDuration(TownID town_id); |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
245 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
246 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
247 |
* Find out if an action can currently be performed on the town. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
248 |
* @param town_id The town to perform the action on. |
10865
c4b3ddd2e9da
(svn r13416) [NoAI] -Fix: make doxygen happy again
truebrain
parents:
10859
diff
changeset
|
249 |
* @param town_action The action to perform on the town. |
10859
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
250 |
* @pre IsValidTown(town_id). |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
251 |
* @return True if and only if the action can performed. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
252 |
*/ |
10865
c4b3ddd2e9da
(svn r13416) [NoAI] -Fix: make doxygen happy again
truebrain
parents:
10859
diff
changeset
|
253 |
static bool IsActionAvailable(TownID town_id, TownAction town_action); |
10859
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
254 |
|
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
255 |
/** |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
256 |
* Perform a town action on this town. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
257 |
* @param town_id The town to perform the action on. |
10865
c4b3ddd2e9da
(svn r13416) [NoAI] -Fix: make doxygen happy again
truebrain
parents:
10859
diff
changeset
|
258 |
* @param town_action The action to perform on the town. |
10859
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
259 |
* @pre IsValidTown(town_id). |
10865
c4b3ddd2e9da
(svn r13416) [NoAI] -Fix: make doxygen happy again
truebrain
parents:
10859
diff
changeset
|
260 |
* @pre IsActionAvailable(town_id, town_action). |
10859
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
261 |
* @return True if the action succeeded. |
4c14a8041c0a
(svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents:
10844
diff
changeset
|
262 |
*/ |
10865
c4b3ddd2e9da
(svn r13416) [NoAI] -Fix: make doxygen happy again
truebrain
parents:
10859
diff
changeset
|
263 |
static bool PerformTownAction(TownID town_id, TownAction town_action); |
10869
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
264 |
|
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
265 |
/** |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
266 |
* Get the rating of a company within a town. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
267 |
* @param town_id The town to get the rating for. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
268 |
* @param company_id The company to get the rating for. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
269 |
* @pre IsValidTown(town_id). |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
270 |
* @pre AICompany.ResolveCompanyID(company) != AICompany::INVALID_COMPANY. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
271 |
* @return The rating as shown to humans. |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
272 |
*/ |
4fdb11e1b599
(svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents:
10865
diff
changeset
|
273 |
static TownRating GetRating(TownID town_id, AICompany::CompanyID company_id); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
274 |
}; |
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
275 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
276 |
#endif /* AI_TOWN_HPP */ |