(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.
This commit is contained in:
frosch
2010-01-04 19:42:29 +00:00
parent b1c19315e7
commit 9e3c107ffe
17 changed files with 68 additions and 110 deletions

View File

@@ -23,6 +23,16 @@ class AIWaypoint : public AIBaseStation {
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.
*/
@@ -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 */