diff options
author | yexo <yexo@openttd.org> | 2010-08-07 20:51:53 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-08-07 20:51:53 +0000 |
commit | 178f74c31cd79ac248308a6fa389e5aa223b0895 (patch) | |
tree | e782722a0c69d4242fffc9e12fad9409679221d0 /src/ai/api/ai_industry.hpp | |
parent | af9d8824bd7d08fa512f34c02c238d0042d060a7 (diff) | |
download | openttd-178f74c31cd79ac248308a6fa389e5aa223b0895.tar.xz |
(svn r20399) -Change: [NoAI] AIIndustry::IsCargoAccepted now returns 3 possible values so AIs can detect a temporaral refusal from an industry to accept some cargo type
Diffstat (limited to 'src/ai/api/ai_industry.hpp')
-rw-r--r-- | src/ai/api/ai_industry.hpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ai/api/ai_industry.hpp b/src/ai/api/ai_industry.hpp index 0d662d2b6..85f2a4dee 100644 --- a/src/ai/api/ai_industry.hpp +++ b/src/ai/api/ai_industry.hpp @@ -22,6 +22,13 @@ public: /** Get the name of this class to identify it towards squirrel. */ static const char *GetClassName() { return "AIIndustry"; } + /** Ways for an industry to accept a cargo. */ + enum CargoAcceptState { + CAS_NOT_ACCEPTED, ///< The CargoID is not accepted by this industry. + CAS_ACCEPTED, ///< The industry currently accepts this CargoID. + CAS_TEMP_REFUSED, ///< The industry temporarily refuses to accept this CargoID but may do so again in the future. + }; + /** * Gets the number of industries. * @return The number of industries. @@ -56,14 +63,14 @@ public: static char *GetName(IndustryID industry_id); /** - * See if an industry accepts a certain cargo. + * See whether an industry currently accepts a certain cargo. * @param industry_id The index of the industry. * @param cargo_id The index of the cargo. * @pre IsValidIndustry(industry_id). * @pre AICargo::IsValidCargo(cargo_id). - * @return True if and only if the industry accepts the cargo. + * @return Whether the industry accepts, temporarily refuses or never accepts this cargo. */ - static bool IsCargoAccepted(IndustryID industry_id, CargoID cargo_id); + static CargoAcceptState IsCargoAccepted(IndustryID industry_id, CargoID cargo_id); /** * Get the amount of cargo stockpiled for processing. |