summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_rail.hpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-12-29 23:20:12 +0000
committeryexo <yexo@openttd.org>2010-12-29 23:20:12 +0000
commit5b25e620dd747d35b024d6d244be9fc7002e38b0 (patch)
tree6b50152523558815c8797d310f271816a6fd2dd0 /src/ai/api/ai_rail.hpp
parentc986325763e1387b7e7fc358af91c2341a038dbe (diff)
downloadopenttd-5b25e620dd747d35b024d6d244be9fc7002e38b0.tar.xz
(svn r21663) -Add: [NoAI]: AIRail::GetName() to get the name of a railtype
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 8b858c0ad..688377f8a 100644
--- a/src/ai/api/ai_rail.hpp
+++ b/src/ai/api/ai_rail.hpp
@@ -97,6 +97,18 @@ public:
};
/**
+ * Get the name of a rail type.
+ * @param rail_type The rail type to get the name of.
+ * @pre IsRailTypeAvailable(rail_type).
+ * @return The name the rail type has.
+ * @note Since there is no string with only the name of the track, the text which
+ * is shown in the dropdown where you can chose a track type is returned. This
+ * means that the name could be something like "Maglev construction" instead
+ * of just "Maglev".
+ */
+ static char *GetName(RailType rail_type);
+
+ /**
* Checks whether the given tile is actually a tile with rail that can be
* used to traverse a tile. This excludes rail depots but includes
* stations and waypoints.