AIWaypoint Class Reference

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

Inheritance diagram for AIWaypoint:

AIObject

Public Types

enum  SpecialWaypointIDs { WAYPOINT_INVALID = 0xFFFF }
 Special waypoint IDs signalling different kinds of waypoints. More...

Static Public Member Functions

static bool IsValidWaypoint (WaypointID waypoint_id)
 Checks whether the given waypoint is valid and owned by you.
static WaypointID GetWaypointID (TileIndex tile)
 Get the WaypointID of a tile.
static char * GetName (WaypointID waypoint_id)
 Get the name of a waypoint.
static bool SetName (WaypointID waypoint_id, const char *name)
 Set the name this waypoint.
static TileIndex GetLocation (WaypointID waypoint_id)
 Get the current location of a waypoint.

Detailed Description

Class that handles all waypoint related functions.

Member Enumeration Documentation

Special waypoint IDs signalling different kinds of waypoints.

Enumerator:
WAYPOINT_INVALID  An invalid WaypointID.


Member Function Documentation

static bool AIWaypoint::IsValidWaypoint ( WaypointID  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.

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

Get the WaypointID of a tile.

Parameters:
tile The tile to find the WaypointID of.
Precondition:
AIRail::IsRailWaypointTile(tile).
Returns:
WaypointID of the waypoint.

static char* AIWaypoint::GetName ( WaypointID  waypoint_id  )  [static]

Get the name of a waypoint.

Parameters:
waypoint_id The waypoint to get the name of.
Precondition:
IsValidWaypoint(waypoint_id).
Returns:
The name of the waypoint.

static bool AIWaypoint::SetName ( WaypointID  waypoint_id,
const char *  name 
) [static]

Set the name this waypoint.

Parameters:
waypoint_id The waypoint to set the name of.
name The new name of the waypoint.
Precondition:
IsValidWaypointwaypoint_id).

'name' must have at least one character.

'name' must have at most 30 characters.

Exceptions:
AIError::ERR_NAME_IS_NOT_UNIQUE 
Returns:
True if the name was changed.

static TileIndex AIWaypoint::GetLocation ( WaypointID  waypoint_id  )  [static]

Get the current location of a waypoint.

Parameters:
waypoint_id The waypoint to get the location of.
Precondition:
IsValidWaypoint(waypoint_id).
Returns:
The tile the waypoint is currently on.


Generated on Tue Jan 5 21:07:02 2010 for OpenTTD NoAI API by  doxygen 1.5.6