# AIWaypoint Class Reference

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

`#include <ai_waypoint.hpp>`

Inheritance diagram for AIWaypoint:

## Static Public Member Functions

static const char * | GetClassName ()
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.

## Detailed Description

Class that handles all waypoint related functions.

Definition at line 22 of file ai_waypoint.hpp.

## Member Function Documentation

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.

Definition at line 17 of file ai_waypoint.cpp.

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.

Definition at line 23 of file ai_waypoint.cpp.

References GetStationIndex(), AIRail::IsRailWaypointTile(), and AIBaseStation::STATION_INVALID.

The documentation for this class was generated from the following files:

- src/ai/api/ai_waypoint.hpp
- src/ai/api/ai_waypoint.cpp