diff options
author | truebrain <truebrain@openttd.org> | 2011-11-23 16:09:46 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-11-23 16:09:46 +0000 |
commit | ef02931a3232abb594c1d00db8c1faacd829999f (patch) | |
tree | 04976dddb31d74236466978f9cda04073e6d477c /src/ai/api/ai_town.hpp | |
parent | 44a1ae8cf20f3869a044b697b9d8e2ec9d0048d9 (diff) | |
download | openttd-ef02931a3232abb594c1d00db8c1faacd829999f.tar.xz |
(svn r23302) -Add: [NoAI] AITown::GetCargoGoal and AITown::GetGrowthRate to query statistics about a town regarding its growing
Diffstat (limited to 'src/ai/api/ai_town.hpp')
-rw-r--r-- | src/ai/api/ai_town.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ai/api/ai_town.hpp b/src/ai/api/ai_town.hpp index da86d5994..165045f5f 100644 --- a/src/ai/api/ai_town.hpp +++ b/src/ai/api/ai_town.hpp @@ -187,6 +187,28 @@ public: static int32 GetLastMonthReceived(TownID town_id, AICargo::TownEffect towneffect_id); /** + * Get the amount of cargo that needs to be delivered (per TownEffect) for a + * town to grow. All goals need to be reached before a town will grow. + * @param town_id The index of the town. + * @param towneffect_id The index of the towneffect. + * @pre IsValidTown(town_id). + * @pre AICargo::IsValidTownEffect(cargo_id). + * @return The goal of the cargo. + * @note Goals can change over time. For example with a changing snowline, or + * with a growing town. + */ + static uint32 GetCargoGoal(TownID town_id, AICargo::TownEffect towneffect_id); + + /** + * Get the amount of days between town growth. + * @param town_id The index of the town. + * @pre IsValidTown(town_id). + * @return True if the action succeeded. + * @note This function does not indicate when it will grow next. It only tells you the time between growths. + */ + static int32 GetGrowthRate(TownID town_id); + + /** * Get the manhattan distance from the tile to the AITown::GetLocation() * of the town. * @param town_id The town to get the distance to. |