summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_waypoint.hpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-01-04 19:42:29 +0000
committerfrosch <frosch@openttd.org>2010-01-04 19:42:29 +0000
commit1ed599f5cf6a0dec14d91d5442a08560e254d35c (patch)
tree969762c9812a05d4cc85ffc522779bbc7667496a /src/ai/api/ai_waypoint.hpp
parent27fc22a76bf470c2088a38d57d9cd2a8e481cafb (diff)
downloadopenttd-1ed599f5cf6a0dec14d91d5442a08560e254d35c.tar.xz
(svn r18725) -Add: [NoAI] AIWaypoint::WaypointType and AIWaypoint::HasWaypointType().
-Change: [NoAI] Constructor of AIWaypoint now takes a WaypointType to also handle buoys. -Remove: [NoAI] AIBuoyList.
Diffstat (limited to 'src/ai/api/ai_waypoint.hpp')
-rw-r--r--src/ai/api/ai_waypoint.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ai/api/ai_waypoint.hpp b/src/ai/api/ai_waypoint.hpp
index a781a0ba9..ddd6168d5 100644
--- a/src/ai/api/ai_waypoint.hpp
+++ b/src/ai/api/ai_waypoint.hpp
@@ -24,6 +24,16 @@ public:
static const char *GetClassName() { return "AIWaypoint"; }
/**
+ * Type of waypoints known in the game.
+ */
+ enum WaypointType {
+ /* Values are important, as they represent the internal state of the game. */
+ WAYPOINT_RAIL = 0x01, //!< Rail waypoint
+ WAYPOINT_BUOY = 0x10, //!< Buoy
+ WAYPOINT_ANY = 0x11, //!< All waypoint types
+ };
+
+ /**
* All waypoint related error messages.
*/
enum ErrorMessages {
@@ -51,6 +61,16 @@ public:
* @return StationID of the waypoint.
*/
static StationID GetWaypointID(TileIndex tile);
+
+ /**
+ * Check if any part of the waypoint contains a waypoint of the type waypoint_type
+ * @param waypoint_id The waypoint to look at.
+ * @param waypoint_type The WaypointType to look for.
+ * @return True if the waypoint has a waypoint part of the type waypoint_type.
+ */
+ static bool HasWaypointType(StationID waypoint_id, WaypointType waypoint_type);
};
+DECLARE_ENUM_AS_BIT_SET(AIWaypoint::WaypointType);
+
#endif /* AI_WAYPOINT_HPP */