summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_engine.hpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-02-19 19:44:19 +0000
committeryexo <yexo@openttd.org>2009-02-19 19:44:19 +0000
commit3491b0fab9e43c3fb13872b019bafbc11c202575 (patch)
tree86c40a8e2d8fb646060ac7b5413ea4ea22218299 /src/ai/api/ai_engine.hpp
parentce5b380a1d1173abc09e8affa2f2788e592228e5 (diff)
downloadopenttd-3491b0fab9e43c3fb13872b019bafbc11c202575.tar.xz
(svn r15524) -Add [NoAI]: AIEngine::GetPower, AIEngine::GetWeight and AIEngine::GetMaxTractiveEffort.
Diffstat (limited to 'src/ai/api/ai_engine.hpp')
-rw-r--r--src/ai/api/ai_engine.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/ai/api/ai_engine.hpp b/src/ai/api/ai_engine.hpp
index f28f4ffcd..93c6f2233 100644
--- a/src/ai/api/ai_engine.hpp
+++ b/src/ai/api/ai_engine.hpp
@@ -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.
@@ -124,6 +126,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.
* @pre IsValidEngine(engine_id).