mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r17014) -Add [NoAI]: AIEngine::GetDesignDate
This commit is contained in:
parent
f9de918274
commit
ef4ecc4cc3
@ -153,6 +153,13 @@
|
||||
return ::Engine::Get(engine_id)->GetDisplayMaxTractiveEffort();
|
||||
}
|
||||
|
||||
/* static */ int32 AIEngine::GetDesignDate(EngineID engine_id)
|
||||
{
|
||||
if (!IsValidEngine(engine_id)) return -1;
|
||||
|
||||
return ::Engine::Get(engine_id)->intro_date;
|
||||
}
|
||||
|
||||
/* static */ AIVehicle::VehicleType AIEngine::GetVehicleType(EngineID engine_id)
|
||||
{
|
||||
if (!IsValidEngine(engine_id)) return AIVehicle::VT_INVALID;
|
||||
|
@ -152,6 +152,14 @@ public:
|
||||
*/
|
||||
static int32 GetMaxTractiveEffort(EngineID engine_id);
|
||||
|
||||
/**
|
||||
* Get the date this engine was designed.
|
||||
* @param engine_id The engine to get the design date of.
|
||||
* @pre IsValidEngine(engine_id).
|
||||
* @return The date this engine was designed.
|
||||
*/
|
||||
static int32 GetDesignDate(EngineID engine_id);
|
||||
|
||||
/**
|
||||
* Get the type of an engine.
|
||||
* @param engine_id The engine to get the type of.
|
||||
|
@ -31,6 +31,7 @@ void SQAIEngine_Register(Squirrel *engine) {
|
||||
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetPower, "GetPower", 2, ".i");
|
||||
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetWeight, "GetWeight", 2, ".i");
|
||||
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetMaxTractiveEffort, "GetMaxTractiveEffort", 2, ".i");
|
||||
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetDesignDate, "GetDesignDate", 2, ".i");
|
||||
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::GetVehicleType, "GetVehicleType", 2, ".i");
|
||||
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::IsWagon, "IsWagon", 2, ".i");
|
||||
SQAIEngine.DefSQStaticMethod(engine, &AIEngine::CanRunOnRail, "CanRunOnRail", 3, ".ii");
|
||||
|
Loading…
Reference in New Issue
Block a user