Class that handles all waypoint related functions. More...
#include <ai_waypoint.hpp>
Public Types | |
enum | WaypointType { WAYPOINT_RAIL = 0x01, WAYPOINT_BUOY = 0x10, WAYPOINT_ANY = 0x11 } |
Type of waypoints known in the game. More... | |
enum | ErrorMessages { ERR_WAYPOINT_BASE = AIError::ERR_CAT_WAYPOINT << AIError::ERR_CAT_BIT_SIZE, ERR_WAYPOINT_TOO_CLOSE_TO_ANOTHER_WAYPOINT, ERR_WAYPOINT_ADJOINS_MULTIPLE_WAYPOINTS } |
All waypoint related error messages. More... | |
Static Public Member Functions | |
static const char * | GetClassName () |
Get the name of this class to identify it towards squirrel. | |
static bool | IsValidWaypoint (StationID waypoint_id) |
Checks whether the given waypoint is valid and owned by you. | |
static StationID | GetWaypointID (TileIndex tile) |
Get the StationID of a tile. | |
static bool | HasWaypointType (StationID waypoint_id, WaypointType waypoint_type) |
Check if any part of the waypoint contains a waypoint of the type waypoint_type. |
Class that handles all waypoint related functions.
Definition at line 22 of file ai_waypoint.hpp.
All waypoint related error messages.
Definition at line 40 of file ai_waypoint.hpp.
Type of waypoints known in the game.
Definition at line 30 of file ai_waypoint.hpp.
static const char* AIWaypoint::GetClassName | ( | ) | [inline, static] |
Get the name of this class to identify it towards squirrel.
Reimplemented from AIBaseStation.
Definition at line 25 of file ai_waypoint.hpp.
Get the StationID of a tile.
tile | The tile to find the StationID of. |
Definition at line 24 of file ai_waypoint.cpp.
References GetStationIndex(), AIMarine::IsBuoyTile(), AIRail::IsRailWaypointTile(), and AIBaseStation::STATION_INVALID.
bool AIWaypoint::HasWaypointType | ( | StationID | waypoint_id, | |
WaypointType | waypoint_type | |||
) | [static] |
Check if any part of the waypoint contains a waypoint of the type waypoint_type.
waypoint_id | The waypoint to look at. | |
waypoint_type | The WaypointType to look for. |
Definition at line 31 of file ai_waypoint.cpp.
References SpecializedStation< Waypoint, true >::Get(), HasExactlyOneBit(), and IsValidWaypoint().
bool AIWaypoint::IsValidWaypoint | ( | StationID | waypoint_id | ) | [static] |
Checks whether the given waypoint is valid and owned by you.
waypoint_id | The waypoint to check. |
Definition at line 18 of file ai_waypoint.cpp.
References _current_company, SpecializedStation< Waypoint, true >::GetIfValid(), BaseStation::owner, and OWNER_NONE.
Referenced by HasWaypointType().