#include <ai_waypoint.hpp>
Public Types | |
enum | SpecialWaypointIDs { WAYPOINT_INVALID = -1 } |
Static Public Member Functions | |
static const char * | GetClassName () |
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. |
Definition at line 14 of file ai_waypoint.hpp.
bool AIWaypoint::IsValidWaypoint | ( | WaypointID | waypoint_id | ) | [static] |
Checks whether the given waypoint is valid and owned by you.
waypoint_id | The waypoint to check. |
Definition at line 15 of file ai_waypoint.cpp.
Referenced by GetLocation(), GetName(), and SetName().
WaypointID AIWaypoint::GetWaypointID | ( | TileIndex | tile | ) | [static] |
Get the WaypointID of a tile.
tile | The tile to find the WaypointID of. |
Definition at line 20 of file ai_waypoint.cpp.
References GetWaypointIndex(), AIRail::IsRailWaypointTile(), and WAYPOINT_INVALID.
char * AIWaypoint::GetName | ( | WaypointID | waypoint_id | ) | [static] |
Get the name of a waypoint.
waypoint_id | The waypoint to get the name of. |
Definition at line 27 of file ai_waypoint.cpp.
References IsValidWaypoint().
bool AIWaypoint::SetName | ( | WaypointID | waypoint_id, | |
const char * | name | |||
) | [static] |
Set the name this waypoint.
waypoint_id | The waypoint to set the name of. | |
name | The new name of the waypoint. |
'name' must have at least one character.
'name' must have at most 30 characters.
AIError::ERR_NAME_IS_NOT_UNIQUE |
Definition at line 39 of file ai_waypoint.cpp.
References CMD_RENAME_WAYPOINT, AIObject::DoCommand(), EnforcePrecondition, EnforcePreconditionCustomError, AIError::ERR_PRECONDITION_STRING_TOO_LONG, IsValidWaypoint(), MAX_LENGTH_WAYPOINT_NAME_BYTES, and StrEmpty().
TileIndex AIWaypoint::GetLocation | ( | WaypointID | waypoint_id | ) | [static] |
Get the current location of a waypoint.
waypoint_id | The waypoint to get the location of. |
Definition at line 48 of file ai_waypoint.cpp.
References INVALID_TILE, and IsValidWaypoint().