summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_rail.hpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-04-09 12:02:50 +0000
committeryexo <yexo@openttd.org>2010-04-09 12:02:50 +0000
commita7e31778b3d75f73b740534c6a9d8830104f1a9c (patch)
tree70611cdfc9495ff5a86be36c49ab01444eb4475c /src/ai/api/ai_rail.hpp
parent737b003c8a1182eaaabb4051ebc57a9cdd9df929 (diff)
downloadopenttd-a7e31778b3d75f73b740534c6a9d8830104f1a9c.tar.xz
(svn r19591) -Add: [NoAI] AIRail::GetMaxSpeed(RailType) to get the speed limit of railtypes
Diffstat (limited to 'src/ai/api/ai_rail.hpp')
-rw-r--r--src/ai/api/ai_rail.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ai/api/ai_rail.hpp b/src/ai/api/ai_rail.hpp
index e82d01ae9..5a8a3d111 100644
--- a/src/ai/api/ai_rail.hpp
+++ b/src/ai/api/ai_rail.hpp
@@ -440,6 +440,18 @@ public:
* @return The baseprice of building the given object.
*/
static Money GetBuildCost(RailType railtype, BuildType build_type);
+
+ /**
+ * Get the maximum speed of trains running on this railtype.
+ * @param railtype The railtype to get the maximum speed of.
+ * @pre IsRailTypeAvailable(railtype)
+ * @return The maximum speed trains can run on this railtype
+ * or 0 if there is no limit.
+ * @note The speed is in OpenTTD's internal speed unit.
+ * This is mph / 1.6, which is roughly km/h.
+ * To get km/h multiply this number by 1.00584.
+ */
+ static int32 GetMaxSpeed(RailType railtype);
};
#endif /* AI_RAIL_HPP */