(svn r15524) -Add [NoAI]: AIEngine::GetPower, AIEngine::GetWeight and AIEngine::GetMaxTractiveEffort.

This commit is contained in:
yexo
2009-02-19 19:44:19 +00:00
parent 581c0a9a5d
commit 157bf66b01
5 changed files with 922 additions and 85 deletions

View File

@@ -82,6 +82,7 @@ public:
* reliability (you most likely don't want to buy it).
* @param engine_id The engine to get the reliability of.
* @pre IsValidEngine(engine_id).
* @pre GetVehicleType(engine_id) != AIVehicle::VT_TRAIN || !IsWagon(engine_id).
* @return The reliability the engine has.
*/
static int32 GetReliability(EngineID engine_id);
@@ -90,6 +91,7 @@ public:
* Get the maximum speed of an engine.
* @param engine_id The engine to get the maximum speed of.
* @pre IsValidEngine(engine_id).
* @pre GetVehicleType(engine_id) != AIVehicle::VT_TRAIN || !IsWagon(engine_id).
* @return The maximum speed the engine has.
* @note The speed is in OpenTTD's internal speed unit.
* This is mph / 1.6, which is roughly km/h.
@@ -123,6 +125,33 @@ public:
*/
static Money GetRunningCost(EngineID engine_id);
/**
* Get the power of an engine.
* @param engine_id The engine to get the power of.
* @pre IsValidEngine(engine_id).
* @pre GetVehicleType(engine_id) == AIVehicle::VT_RAIL && !IsWagon(engine_id).
* @return The power of the engine in hp.
*/
static int32 GetPower(EngineID engine_id);
/**
* Get the weight of an engine.
* @param engine_id The engine to get the weight of.
* @pre IsValidEngine(engine_id).
* @pre GetVehicleType(engine_id) == AIVehicle::VT_RAIL.
* @return The weight of the engine in metric tons.
*/
static int32 GetWeight(EngineID engine_id);
/**
* Get the maximum tractive effort of an engine.
* @param engine_id The engine to get the maximum tractive effort of.
* @pre IsValidEngine(engine_id).
* @pre GetVehicleType(engine_id) == AIVehicle::VT_RAIL && !IsWagon(engine_id).
* @return The maximum tractive effort of the engine in kN.
*/
static int32 GetMaxTractiveEffort(EngineID engine_id);
/**
* Get the type of an engine.
* @param engine_id The engine to get the type of.