diff options
author | smatz <smatz@openttd.org> | 2009-08-27 13:50:07 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-08-27 13:50:07 +0000 |
commit | 713f5d44ce5328c785f172f7cf798407e6d78fcd (patch) | |
tree | da8a764a78fd23592a27e441595380c9ee2d2022 /src/ai/api/ai_town.hpp | |
parent | 072ce4bb17dcb02e8e832f46e4fcadfd7c4be944 (diff) | |
download | openttd-713f5d44ce5328c785f172f7cf798407e6d78fcd.tar.xz |
(svn r17294) -Add [NoAI]: AITown::GetLastMonthTransportedPercentage and AIIndustry::GetLastMonthTransportedPercentage
Diffstat (limited to 'src/ai/api/ai_town.hpp')
-rw-r--r-- | src/ai/api/ai_town.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ai/api/ai_town.hpp b/src/ai/api/ai_town.hpp index dca8a36e9..d59dd9261 100644 --- a/src/ai/api/ai_town.hpp +++ b/src/ai/api/ai_town.hpp @@ -176,6 +176,18 @@ public: static int32 GetLastMonthTransported(TownID town_id, CargoID cargo_id); /** + * Get the percentage of transported production of the given cargo at a town. + * @param town_id The index of the town. + * @param cargo_id The index of the cargo. + * @pre IsValidTown(town_id). + * @pre AICargo::IsValidCargo(cargo_id). + * @pre AICargo::GetTownEffect(cargo_id) == TE_PASSENGERS || AICargo::GetTownEffect(cargo_id) == TE_MAIL. + * @return The percentage of given cargo transported from this town last month. + * @post Return value is always non-negative. + */ + static int32 GetLastMonthTransportedPercentage(TownID town_id, CargoID cargo_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. |