author | truebrain |
Fri, 06 Jun 2008 18:25:42 +0000 | |
branch | noai |
changeset 10844 | affb2821fb9f |
parent 10841 | a8942f5f7e3b |
child 10859 | 4c14a8041c0a |
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" |
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
9 |
|
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
|
10 |
/** |
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 |
* 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
|
12 |
*/ |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
13 |
class AITown : public AIObject { |
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
14 |
public: |
9529
5f26f4bc574b
(svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents:
9526
diff
changeset
|
15 |
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
|
16 |
|
5f26f4bc574b
(svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents:
9526
diff
changeset
|
17 |
/** |
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
|
18 |
* 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
|
19 |
* @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
|
20 |
* @post Return value is always non-negative. |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
21 |
*/ |
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
|
22 |
static TownID GetMaxTownID(); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
23 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
24 |
/** |
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
|
25 |
* 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
|
26 |
* 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
|
27 |
* @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
|
28 |
* @post Return value is always non-negative. |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
29 |
*/ |
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
|
30 |
static int32 GetTownCount(); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
31 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
32 |
/** |
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
|
33 |
* 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
|
34 |
* @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
|
35 |
* @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
|
36 |
*/ |
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
|
37 |
static bool IsValidTown(TownID town_id); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
38 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
39 |
/** |
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
|
40 |
* 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
|
41 |
* @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
|
42 |
* @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
|
43 |
* @return The name of the town. |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
44 |
*/ |
9582
40f54a61bb17
(svn r9606) [NoAI] -Fix: make GetXXX in AITown static, so we can use it without AITown instance
truelight
parents:
9541
diff
changeset
|
45 |
static char *GetName(TownID town_id); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
46 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
47 |
/** |
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
|
48 |
* 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
|
49 |
* @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
|
50 |
* @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
|
51 |
* @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
|
52 |
* @post Return value is always non-negative. |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
53 |
*/ |
9582
40f54a61bb17
(svn r9606) [NoAI] -Fix: make GetXXX in AITown static, so we can use it without AITown instance
truelight
parents:
9541
diff
changeset
|
54 |
static int32 GetPopulation(TownID town_id); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
55 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
56 |
/** |
10840
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
57 |
* 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
|
58 |
* @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
|
59 |
* @pre IsValidTown(town_id). |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
60 |
* @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
|
61 |
* @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
|
62 |
*/ |
10844
affb2821fb9f
(svn r13395) [NoAI] -Fix [API CHANGE]: Rename AIOrder::GetNumberOfORders to AIOrder::GetOrderCount
truebrain
parents:
10841
diff
changeset
|
63 |
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
|
64 |
|
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
65 |
/** |
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
|
66 |
* Gets the location of the town. |
10841
a8942f5f7e3b
(svn r13392) [NoAI] -Fix: comment fix in AITown::GetLocation
truebrain
parents:
10840
diff
changeset
|
67 |
* @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
|
68 |
* @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
|
69 |
* @return The location of the town. |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
70 |
*/ |
9582
40f54a61bb17
(svn r9606) [NoAI] -Fix: make GetXXX in AITown static, so we can use it without AITown instance
truelight
parents:
9541
diff
changeset
|
71 |
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
|
72 |
|
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
73 |
/** |
10840
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
74 |
* 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
|
75 |
* @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
|
76 |
* @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
|
77 |
* @pre IsValidTown(town_id). |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
78 |
* @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
|
79 |
* @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
|
80 |
* @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
|
81 |
* @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
|
82 |
*/ |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
83 |
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
|
84 |
|
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
85 |
/** |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
86 |
* 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
|
87 |
* @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
|
88 |
* @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
|
89 |
* @pre IsValidTown(town_id). |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
90 |
* @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
|
91 |
* @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
|
92 |
* @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
|
93 |
* @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
|
94 |
*/ |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
95 |
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
|
96 |
|
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
97 |
/** |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
98 |
* 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
|
99 |
* @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
|
100 |
* @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
|
101 |
* @pre IsValidTown(town_id). |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
102 |
* @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
|
103 |
* @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
|
104 |
* @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
|
105 |
* @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
|
106 |
*/ |
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
107 |
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
|
108 |
|
fd5945ab9ea6
(svn r13391) [NoAI] -Add: added AITown.GetNumHouses(), AITown.GetLastMonthProduction(), AITown.GetLastMonthTransported() and AITown.GetMaxProduction()
glx
parents:
10361
diff
changeset
|
109 |
/** |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
110 |
* 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
|
111 |
* of the town. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
112 |
* @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
|
113 |
* @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
|
114 |
* @pre IsValidTown(town_id). |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
115 |
* @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
|
116 |
*/ |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
117 |
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
|
118 |
|
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
119 |
/** |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
120 |
* 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
|
121 |
* of the town. |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
122 |
* @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
|
123 |
* @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
|
124 |
* @pre IsValidTown(town_id). |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
125 |
* @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
|
126 |
*/ |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9801
diff
changeset
|
127 |
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
|
128 |
|
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
129 |
/** |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
130 |
* 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
|
131 |
* 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
|
132 |
* @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
|
133 |
* @param tile The tile to check. |
3234cb59de55
(svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents:
10339
diff
changeset
|
134 |
* @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
|
135 |
*/ |
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
|
136 |
static bool IsWithinTownInfluence(TownID town_id, TileIndex tile); |
9380
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
137 |
}; |
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
138 |
|
f4c7eb98b43d
(svn r9169) [NoAI] -Add: some wrapper functions for town related queries.
rubidium
parents:
diff
changeset
|
139 |
#endif /* AI_TOWN_HPP */ |