diff options
author | yexo <yexo@openttd.org> | 2010-01-02 15:52:29 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-01-02 15:52:29 +0000 |
commit | fe67e85700988303c6e0148fa6212bf3904c8fca (patch) | |
tree | 84c8f9073611d231b11fa755b46c051ccc587ade /src/ai/api/ai_engine.hpp | |
parent | ea75e7da60300bd0b1913a1a19ea554da21a592c (diff) | |
download | openttd-fe67e85700988303c6e0148fa6212bf3904c8fca.tar.xz |
(svn r18687) -Add [NoAI]: AIEngine::IsBuildable to check if you can build a certain engine.
-Change: AIEngine::IsValidEngine will now also return true when you have at least one vehicle of that type even if you can't build it anymore.
Diffstat (limited to 'src/ai/api/ai_engine.hpp')
-rw-r--r-- | src/ai/api/ai_engine.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ai/api/ai_engine.hpp b/src/ai/api/ai_engine.hpp index 3d213fd3e..431f622c8 100644 --- a/src/ai/api/ai_engine.hpp +++ b/src/ai/api/ai_engine.hpp @@ -26,13 +26,21 @@ public: static const char *GetClassName() { return "AIEngine"; } /** - * Checks whether the given engine type is valid and buildable by you. + * Checks whether the given engine type is valid. An engine is valid if you + * have at least one vehicle of this engine or it's currently buildable. * @param engine_id The engine to check. * @return True if and only if the engine type is valid. */ static bool IsValidEngine(EngineID engine_id); /** + * Checks whether the given engine type is buildable by you. + * @param engine_id The engine to check. + * @return True if and only if the engine type is buildable. + */ + static bool IsBuildable(EngineID engine_id); + + /** * Get the name of an engine. * @param engine_id The engine to get the name of. * @pre IsValidEngine(engine_id). |