Public Types | Static Public Member Functions

AIWaypoint Class Reference

Class that handles all waypoint related functions. More...

Inheritance diagram for AIWaypoint:
AIBaseStation AIObject

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 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.

Detailed Description

Class that handles all waypoint related functions.


Member Enumeration Documentation

All waypoint related error messages.

Enumerator:
ERR_WAYPOINT_BASE 

Base for waypoint related errors.

ERR_WAYPOINT_TOO_CLOSE_TO_ANOTHER_WAYPOINT 

The waypoint is build too close to another waypoint.

ERR_WAYPOINT_ADJOINS_MULTIPLE_WAYPOINTS 

The waypoint would join more then one existing waypoint together.

Type of waypoints known in the game.

Enumerator:
WAYPOINT_RAIL 

Rail waypoint.

WAYPOINT_BUOY 

Buoy.

WAYPOINT_ANY 

All waypoint types.


Member Function Documentation

static StationID AIWaypoint::GetWaypointID ( TileIndex  tile  )  [static]

Get the StationID of a tile.

Parameters:
tile The tile to find the StationID of.
Precondition:
AIRail::IsRailWaypointTile(tile).
Returns:
StationID of the waypoint.
static 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.

Parameters:
waypoint_id The waypoint to look at.
waypoint_type The WaypointType to look for.
Returns:
True if the waypoint has a waypoint part of the type waypoint_type.
static bool AIWaypoint::IsValidWaypoint ( StationID  waypoint_id  )  [static]

Checks whether the given waypoint is valid and owned by you.

Parameters:
waypoint_id The waypoint to check.
Returns:
True if and only if the waypoint is valid.