# waypoint_func.h File Reference

Functions related to waypoints. More...

`#include "direction_type.h"`
`#include "rail_type.h"`
`#include "command_type.h"`
`#include "station_type.h"`

Go to the source code of this file.

## Functions
CommandCost | RemoveBuoy (TileIndex tile, DoCommandFlag flags)
| Remove a buoy.
Axis | GetAxisForNewWaypoint (TileIndex tile)
| Get the axis for a new waypoint.
void | ShowWaypointWindow (const Waypoint *wp)
void | DrawWaypointSprite (int x, int y, int stat_id, RailType railtype)
| Draw a waypoint.

## Detailed Description

Functions related to waypoints.

Definition in file waypoint_func.h.

## Function Documentation

void DrawWaypointSprite | ( | int | x,
|  | int | y,
|  | int | stat_id,
|  | RailType | railtype |
| ) |  |  |

Draw a waypoint.

Parameters:

  | x | coordinate
  | y | coordinate
  | stat_id | station id
  | railtype | RailType to use for

Definition at line 26 of file waypoint.cpp.

References AXIS_X, DrawStationTile(), INVALID_ROADTYPE, and STAT_CLASS_WAYP.

Axis GetAxisForNewWaypoint | ( | TileIndex | tile | ) |

Get the axis for a new waypoint.

This means that if it is a valid tile to build a waypoint on it returns a valid Axis, otherwise an invalid one.

Parameters:

  | tile | the tile to look at.

Returns:
  the axis for the to-be-build waypoint.

Definition at line 137 of file waypoint_cmd.cpp.

References AXIS_X, AXIS_Y, GetRailStationAxis(), GetRailTileType(), GetTrackBits(), INVALID_AXIS, IsRailWaypointTile(), IsTileType(), MP_RAILWAY, RAIL_TILE_NORMAL, TRACK_BIT_X, and TRACK_BIT_Y.

Referenced by IsValidTileForWaypoint().

CommandCost RemoveBuoy | ( | TileIndex | tile,
|  | DoCommandFlag | flags |
| ) |  |  |

Remove a buoy.

Parameters:

  | tile | TileIndex been queried
  | flags | operation to perform

Precondition:
  IsBuoyTile(tile)

Returns:
  cost or failure of operation

Definition at line 380 of file waypoint_cmd.cpp.

References CMD_ERROR, DC_BANKRUPT, DC_EXEC, FACIL_DOCK, GetTileOwner(), HasStationInUse(), INVALID_COMPANY, INVALID_STRING_ID, InvalidateWindowData(), MarkTileDirtyByTile(), and return_cmd_error.