(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.
This commit is contained in:
yexo
2010-01-02 15:52:29 +00:00
parent 2f29975421
commit 8f50437298
9 changed files with 186 additions and 5 deletions

View File

@@ -26,12 +26,20 @@ 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.