OpenTTD

Typedefs | Functions | Variables
station_map.h File Reference

Maps accessors for stations. More...

`#include "rail_map.h"`
`#include "road_map.h"`
`#include "water_map.h"`
`#include "station_func.h"`
`#include "rail.h"`

Go to the source code of this file.

## Typedefs
typedef byte | StationGfx
| Index of station graphics. More...

## Functions
static StationID | GetStationIndex (TileIndex t)
| Get StationID from a tile. More...
static StationType | GetStationType (TileIndex t)
| Get the station type of this tile. More...
static RoadStopType | GetRoadStopType (TileIndex t)
| Get the road stop type of this tile. More...
static StationGfx | GetStationGfx (TileIndex t)
| Get the station graphics of this tile. More...
static void | SetStationGfx (TileIndex t, StationGfx gfx)
| Set the station graphics of this tile. More...
static bool | IsRailStation (TileIndex t)
| Is this station tile a rail station? More...
static bool | IsRailStationTile (TileIndex t)
| Is this tile a station tile and a rail station? More...
static bool | IsRailWaypoint (TileIndex t)
| Is this station tile a rail waypoint? More...
static bool | IsRailWaypointTile (TileIndex t)
| Is this tile a station tile and a rail waypoint? More...
static bool | HasStationRail (TileIndex t)
| Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint? More...
static bool | HasStationTileRail (TileIndex t)
| Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint? More...
static bool | IsAirport (TileIndex t)
| Is this station tile an airport? More...
static bool | IsAirportTile (TileIndex t)
| Is this tile a station tile and an airport tile? More...
bool | IsHangar (TileIndex t)
| Check whether the given tile is a hangar. More...
static bool | IsTruckStop (TileIndex t)
| Is the station at t a truck stop? More...
static bool | IsBusStop (TileIndex t)
| Is the station at t a bus stop? More...
static bool | IsRoadStop (TileIndex t)
| Is the station at t a road station? More...
static bool | IsRoadStopTile (TileIndex t)
| Is tile t a road stop station? More...
static bool | IsStandardRoadStopTile (TileIndex t)
| Is tile t a standard (non-drive through) road stop station? More...
static bool | IsDriveThroughStopTile (TileIndex t)
| Is tile t a drive through road stop station? More...
static StationGfx | GetAirportGfx (TileIndex t)
| Get the station graphics of this airport tile. More...
static DiagDirection | GetRoadStopDir (TileIndex t)
| Gets the direction the road stop entrance points towards. More...
static bool | IsOilRig (TileIndex t)
| Is tile t part of an oilrig? More...
static bool | IsDock (TileIndex t)
| Is tile t a dock tile? More...
static bool | IsDockTile (TileIndex t)
| Is tile t a dock tile? More...
static bool | IsBuoy (TileIndex t)
| Is tile t a buoy tile? More...
static bool | IsBuoyTile (TileIndex t)
| Is tile t a buoy tile? More...
static bool | IsHangarTile (TileIndex t)
| Is tile t an hangar tile? More...
static Axis | GetRailStationAxis (TileIndex t)
| Get the rail direction of a rail station. More...
static Track | GetRailStationTrack (TileIndex t)
| Get the rail track of a rail station tile. More...
static TrackBits | GetRailStationTrackBits (TileIndex t)
| Get the trackbits of a rail station tile. More...
static bool | IsCompatibleTrainStationTile (TileIndex test_tile, TileIndex station_tile)
| Check if a tile is a valid continuation to a railstation tile. More...
static bool | HasStationReservation (TileIndex t)
| Get the reservation state of the rail station. More...
static void | SetRailStationReservation (TileIndex t, bool b)
| Set the reservation state of the rail station. More...
static TrackBits | GetStationReservationTrackBits (TileIndex t)
| Get the reserved track bits for a waypoint. More...
static DiagDirection | GetDockDirection (TileIndex t)
| Get the direction of a dock. More...
static TileIndexDiffC | GetDockOffset (TileIndex t)
| Get the tileoffset from this tile a ship should target to get to this dock. More...
static bool | IsCustomStationSpecIndex (TileIndex t)
| Is there a custom rail station spec on this tile? More...
static void | SetCustomStationSpecIndex (TileIndex t, byte specindex)
| Set the custom station spec for this tile. More...
static uint | GetCustomStationSpecIndex (TileIndex t)
| Get the custom station spec for this tile. More...
static void | SetStationTileRandomBits (TileIndex t, byte random_bits)
| Set the random bits for a station tile. More...
static byte | GetStationTileRandomBits (TileIndex t)
| Get the random bits of a station tile. More...
static void | MakeStation (TileIndex t, Owner o, StationID sid, StationType st, byte section, WaterClass wc=WATER_CLASS_INVALID)
| Make the given tile a station tile. More...
static void | MakeRailStation (TileIndex t, Owner o, StationID sid, Axis a, byte section, RailType rt)
| Make the given tile a rail station tile. More...
static void | MakeRailWaypoint (TileIndex t, Owner o, StationID sid, Axis a, byte section, RailType rt)
| Make the given tile a rail waypoint tile. More...
static void | MakeRoadStop (TileIndex t, Owner o, StationID sid, RoadStopType rst, RoadTypes rt, DiagDirection d)
| Make the given tile a roadstop tile. More...
static void | MakeDriveThroughRoadStop (TileIndex t, Owner station, Owner road, Owner tram, StationID sid, RoadStopType rst, RoadTypes rt, Axis a)
| Make the given tile a drivethrough roadstop tile. More...
static void | MakeAirport (TileIndex t, Owner o, StationID sid, byte section, WaterClass wc)
| Make the given tile an airport tile. More...
static void | MakeBuoy (TileIndex t, StationID sid, WaterClass wc)
| Make the given tile a buoy tile. More...
static void | MakeDock (TileIndex t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
| Make the given tile a dock tile. More...
static void | MakeOilrig (TileIndex t, StationID sid, WaterClass wc)
| Make the given tile an oilrig tile. More...

## Variables
static const int | GFX_DOCK_BASE_WATER_PART = 4
| The offset for the water parts.
static const int | GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET = 4
| The offset for the drive through parts.

## Detailed Description

Maps accessors for stations.

Definition in file station_map.h.

## Typedef Documentation

## ◆ StationGfx

typedef byte StationGfx

Index of station graphics.

See also
  _station_display_datas

Definition at line 21 of file station_map.h.

## Function Documentation

## ◆ GetAirportGfx()

static StationGfx GetAirportGfx | ( | TileIndex | t | ) |
| inline static

Get the station graphics of this airport tile.

Parameters

  t | the tile to query

Precondition
  IsAirport(t)

Returns
  the station graphics

Definition at line 245 of file station_map.h.

Referenced by GetAirportTileIDAtOffset(), AirportTileSpec::GetByTile(), NIHAirportTile::GetGRFID(), NIHAirportTile::GetSpec(), and NIHAirportTile::IsInspectable().

## ◆ GetCustomStationSpecIndex()

static uint GetCustomStationSpecIndex | ( | TileIndex | t | ) |
| inline static

Get the custom station spec for this tile.

Parameters

  t | Tile to query

Precondition
  HasStationTileRail(t)

Returns
  The custom station spec of this tile.

Definition at line 494 of file station_map.h.

Referenced by FindRailStationEnd().

## ◆ GetDockDirection()

static DiagDirection GetDockDirection | ( | TileIndex | t | ) |
| inline static

Get the direction of a dock.

Parameters

  t | Tile to query

Precondition
  IsDock(t)
  t is the land part of the dock

Returns
  The direction of the dock on tile t.

Definition at line 430 of file station_map.h.

References GetStationGfx().

Referenced by RemoveDock().

## ◆ GetDockOffset()

static TileIndexDiffC GetDockOffset | ( | TileIndex | t | ) |
| inline static

Get the tileoffset from this tile a ship should target to get to this dock.

Parameters

  t | Tile to query

Precondition
  IsTileType(t, MP_STATION)
  IsBuoy(t) || IsOilRig(t) || IsDock(t)

Returns
  The offset from this tile that should be used as destination for ships.

Definition at line 444 of file station_map.h.

References DIAGDIR_END.

Referenced by RemoveDock().

## ◆ GetRailStationAxis()

static Axis GetRailStationAxis | ( | TileIndex | t | ) |
| inline static

Get the rail direction of a rail station.

Parameters

  t | Tile to query

Precondition
  HasStationRail(t)

Returns
  The direction of the rails on tile t.

Definition at line 338 of file station_map.h.

Referenced by FindRailStationEnd(), GetAxisForNewWaypoint(), GetRailStationTrack(), GetRailStationTrackBits(), and MaskWireBits().

## ◆ GetRailStationTrack()

static Track GetRailStationTrack | ( | TileIndex | t | ) |
| inline static

Get the rail track of a rail station tile.

Parameters

  t | Tile to query

Precondition
  HasStationRail(t)

Returns
  The rail track of the rails on tile t.

Definition at line 350 of file station_map.h.

References AxisToTrack(), and GetRailStationAxis().

Referenced by CmdConvertRail(), and GetRailTrackBitsUniversal().

## ◆ GetRailStationTrackBits()

static TrackBits GetRailStationTrackBits | ( | TileIndex | t | ) |
| inline static

Get the trackbits of a rail station tile.

Parameters

  t | Tile to query

Precondition
  HasStationRail(t)

Returns
  The trackbits of the rails on tile t.

Definition at line 361 of file station_map.h.

References AxisToTrackBits(), and GetRailStationAxis().

Referenced by GetStationReservationTrackBits().

## ◆ GetRoadStopDir()

static DiagDirection GetRoadStopDir | ( | TileIndex | t | ) |
| inline static

Gets the direction the road stop entrance points towards.

Parameters

  t | the tile of the road stop

Precondition
  IsRoadStopTile(t)

Returns
  the direction of the entrance

Definition at line 258 of file station_map.h.

References GetStationGfx().

Referenced by CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanEnterNewTile(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanExitOldTile(), CheckFlatLandRoadStop(), GetAnyRoadBits(), GetTileSingleEntry(), RoadVehicle::GetVehicleTrackdir(), RoadStop::IsDriveThroughRoadStopContinuation(), and RoadFindPathToDest().

## ◆ GetRoadStopType()

static RoadStopType GetRoadStopType | ( | TileIndex | t | ) |
| inline static

Get the road stop type of this tile.

Parameters

  t | the tile to query

Precondition
  GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS

Returns
  the road stop type

Definition at line 57 of file station_map.h.

Referenced by CYapfCostRoadT< Types >::OneTileCost(), and RoadFindPathToDest().

## ◆ GetStationGfx()

static StationGfx GetStationGfx | ( | TileIndex | t | ) |
| inline static

Get the station graphics of this tile.

Parameters

  t | the tile to query

Precondition
  IsTileType(t, MP_STATION)

Returns
  the station graphics

Definition at line 69 of file station_map.h.

Referenced by GetDockDirection(), GetRoadStopDir(), IsDriveThroughStopTile(), and IsStandardRoadStopTile().

## ◆ GetStationIndex()

static StationID GetStationIndex | ( | TileIndex | t | ) |
| inline static

Get StationID from a tile.

Parameters

  t | Tile to query station ID from

Precondition
  IsTileType(t, MP_STATION)

Returns
  Station ID of the station at t

Definition at line 29 of file station_map.h.

Referenced by AddNearbyStation(), CheckFlatLandRailStation(), CheckFlatLandRoadStop(), FindRailStationEnd(), BaseStation::GetByTile(), GetNearbyAirportTileInformation(), GetOrderCmdFromTile(), RoadStop::IsDriveThroughRoadStopContinuation(), IsValidTileForWaypoint(), StationRect::ScanForStationTiles(), NIHStation::SetStringParameters(), DepotWindow::SetStringParameters(), NIHAirportTile::SetStringParameters(), Waypoint::TileBelongsToRailStation(), and Station::TileBelongsToRailStation().

## ◆ GetStationReservationTrackBits()

static TrackBits GetStationReservationTrackBits | ( | TileIndex | t | ) |
| inline static

Get the reserved track bits for a waypoint.

Precondition
  HasStationRail(t)

Parameters

  t | the tile

Returns
  reserved track bits

Definition at line 418 of file station_map.h.

References GetRailStationTrackBits(), HasStationReservation(), and TRACK_BIT_NONE.

Referenced by GetReservedTrackbits().

## ◆ GetStationTileRandomBits()

static byte GetStationTileRandomBits | ( | TileIndex | t | ) |
| inline static

Get the random bits of a station tile.

Parameters

  t | Tile to query

Precondition
  IsTileType(t, MP_STATION)

Returns
  The random bits for this station tile.

Definition at line 518 of file station_map.h.

Referenced by AirportTileScopeResolver::GetRandomBits(), and StationScopeResolver::GetRandomBits().

## ◆ GetStationType()

static StationType GetStationType | ( | TileIndex | t | ) |
| inline static

Get the station type of this tile.

Parameters

  t | the tile to query

Precondition
  IsTileType(t, MP_STATION)

Returns
  the station type

Definition at line 45 of file station_map.h.

Referenced by ClearTile_Station(), GetSmallMapRoutesPixels(), IsAirport(), IsBuoy(), IsBusStop(), IsDock(), IsDockTile(), RoadStop::IsDriveThroughRoadStopContinuation(), IsOilRig(), IsRailStation(), IsRailWaypoint(), and IsTruckStop().

## ◆ HasStationRail()

static bool HasStationRail | ( | TileIndex | t | ) |
| inline static

Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?

Parameters

  t | the tile to check

Precondition
  IsTileType(t, MP_STATION)

Returns
  true if and only if the tile has rail

Definition at line 136 of file station_map.h.

References IsRailStation(), and IsRailWaypoint().

Referenced by CmdConvertRail(), FindRailStationEnd(), GetRailTrackBitsUniversal(), GetReservedTrackbits(), GetTileRailType(), and HasStationTileRail().

## ◆ HasStationReservation()

static bool HasStationReservation | ( | TileIndex | t | ) |
| inline static

Get the reservation state of the rail station.

Precondition
  HasStationRail(t)

Parameters

  t | the station tile

Returns
  reservation state

Definition at line 394 of file station_map.h.

Referenced by FollowReservation(), GetStationReservationTrackBits(), CYapfCostRailT< Types >::IsAnyStationTileReserved(), and CYapfReserveTrack< Types >::ReserveRailStationPlatform().

## ◆ HasStationTileRail()

static bool HasStationTileRail | ( | TileIndex | t | ) |
| inline static

Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint?

Parameters

  t | the tile to check

Returns
  true if and only if the tile is a station tile and has rail

Definition at line 147 of file station_map.h.

References HasStationRail(), IsTileType(), and MP_STATION.

Referenced by CanEnterTileOwnerCheck(), MaskWireBits(), and RemoveFromRailBaseStation().

## ◆ IsAirport()

static bool IsAirport | ( | TileIndex | t | ) |
| inline static

Is this station tile an airport?

Parameters

  t | the tile to get the information from

Precondition
  IsTileType(t, MP_STATION)

Returns
  true if and only if the tile is an airport

Definition at line 158 of file station_map.h.

References GetStationType().

Referenced by GetNearbyAirportTileInformation(), and IsAirportTile().

## ◆ IsAirportTile()

static bool IsAirportTile | ( | TileIndex | t | ) |
| inline static

Is this tile a station tile and an airport tile?

Parameters

  t | the tile to get the information from

Returns
  true if and only if the tile is an airport

Definition at line 168 of file station_map.h.

References IsAirport(), IsHangar(), IsTileType(), and MP_STATION.

Referenced by FloodVehicleProc(), FloodVehicles(), and Station::TileBelongsToRailStation().

## ◆ IsBuoy()

static bool IsBuoy | ( | TileIndex | t | ) |
| inline static

Is tile t a buoy tile?

Parameters

  t | Tile to check

Precondition
  IsTileType(t, MP_STATION)

Returns
  `true` if the tile is a buoy

Definition at line 307 of file station_map.h.

References GetStationType().

Referenced by IsBuoyTile().

## ◆ IsBuoyTile()

static bool IsBuoyTile | ( | TileIndex | t | ) |
| inline static

Is tile t a buoy tile?

Parameters

  t | Tile to check

Returns
  `true` if the tile is a buoy

Definition at line 317 of file station_map.h.

References IsBuoy(), IsTileType(), and MP_STATION.

Referenced by GetOrderCmdFromTile().

## ◆ IsBusStop()

static bool IsBusStop | ( | TileIndex | t | ) |
| inline static

Is the station at t a bus stop?

Parameters

  t | Tile to check

Precondition
  IsTileType(t, MP_STATION)

Returns
  `true` if station is a bus stop, `false` otherwise

Definition at line 192 of file station_map.h.

References GetStationType().

## ◆ IsCompatibleTrainStationTile()

static bool IsCompatibleTrainStationTile | ( | TileIndex | test_tile,
|  | TileIndex | station_tile
| ) |  |
| inline static

Check if a tile is a valid continuation to a railstation tile.

The tile test_tile is a valid continuation to station_tile, if all of the following are true:

- test_tile is a rail station tile
- the railtype of test_tile is compatible with the railtype of station_tile
- the tracks on test_tile and station_tile are in the same direction
- both tiles belong to the same station
- test_tile is not blocked (
  See also
    IsStationTileBlocked)
  Parameters

    test_tile | Tile to test
    station_tile | Station tile to compare with

  Precondition
    IsRailStationTile(station_tile)
  Returns
    true if the two tiles are compatible

Definition at line 379 of file station_map.h.

Referenced by ClearPathReservation(), CYapfReserveTrack< Types >::ReserveRailStationPlatform(), and CYapfReserveTrack< Types >::UnreserveSingleTrack().

## ◆ IsCustomStationSpecIndex()

static bool IsCustomStationSpecIndex | ( | TileIndex | t | ) |
| inline static

Is there a custom rail station spec on this tile?

Parameters

  t | Tile to query

Precondition
  HasStationTileRail(t)

Returns
  True if this station is part of a newgrf station.

Definition at line 470 of file station_map.h.

## ◆ IsDock()

static bool IsDock | ( | TileIndex | t | ) |
| inline static

Is tile t a dock tile?

Parameters

  t | Tile to check

Precondition
  IsTileType(t, MP_STATION)

Returns
  `true` if the tile is a dock

Definition at line 286 of file station_map.h.

References GetStationType().

## ◆ IsDockTile()

static bool IsDockTile | ( | TileIndex | t | ) |
| inline static

Is tile t a dock tile?

Parameters

  t | Tile to check

Returns
  `true` if the tile is a dock

Definition at line 296 of file station_map.h.

References GetStationType(), IsTileType(), and MP_STATION.

## ◆ IsDriveThroughStopTile()

static bool IsDriveThroughStopTile | ( | TileIndex | t | ) |
| inline static

Is tile t a drive through road stop station?

Parameters

  t | Tile to check

Returns
  `true` if the tile is a station tile and a drive through road stop

Definition at line 234 of file station_map.h.

References GetStationGfx(), GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET, and IsRoadStopTile().

Referenced by CanFollowRoad(), CheckFlatLandRoadStop(), GetAnyRoadBits(), RoadStop::IsDriveThroughRoadStopContinuation(), CYapfCostRoadT< Types >::OneTileCost(), and RemoveRoad().

## ◆ IsHangar()

bool IsHangar | ( | TileIndex | t | ) |

Check whether the given tile is a hangar.

Parameters

  t | the tile to of whether it is a hangar.

Precondition
  IsTileType(t, MP_STATION)

Returns
  true if and only if the tile is a hangar.

Definition at line 74 of file station_cmd.cpp.

Referenced by IsAirportTile(), and IsHangarTile().

## ◆ IsHangarTile()

static bool IsHangarTile | ( | TileIndex | t | ) |
| inline static

Is tile t an hangar tile?

Parameters

  t | Tile to check

Returns
  `true` if the tile is an hangar

Definition at line 327 of file station_map.h.

References IsHangar(), IsTileType(), and MP_STATION.

Referenced by IsDepotTile().

## ◆ IsOilRig()

static bool IsOilRig | ( | TileIndex | t | ) |
| inline static

Is tile t part of an oilrig?

Parameters

  t | Tile to check

Precondition
  IsTileType(t, MP_STATION)

Returns
  `true` if the tile is an oilrig tile

Definition at line 275 of file station_map.h.

References GetStationType().

## ◆ IsRailStation()

static bool IsRailStation | ( | TileIndex | t | ) |
| inline static

Is this station tile a rail station?

Parameters

  t | the tile to get the information from

Precondition
  IsTileType(t, MP_STATION)

Returns
  true if and only if the tile is a rail station

Definition at line 93 of file station_map.h.

References GetStationType().

Referenced by CheckFlatLandRailStation(), HasStationRail(), and IsRailStationTile().

## ◆ IsRailStationTile()

static bool IsRailStationTile | ( | TileIndex | t | ) |
| inline static

Is this tile a station tile and a rail station?

Parameters

  t | the tile to get the information from

Returns
  true if and only if the tile is a rail station

Definition at line 103 of file station_map.h.

References IsRailStation(), IsTileType(), and MP_STATION.

Referenced by ClearPathReservation(), CmdConvertRail(), FreeTrainReservation(), NPFSaveTargetData(), CYapfReserveTrack< Types >::ReserveSingleTrack(), RestoreTrainReservation(), Station::TileBelongsToRailStation(), and CYapfReserveTrack< Types >::UnreserveSingleTrack().

## ◆ IsRailWaypoint()

static bool IsRailWaypoint | ( | TileIndex | t | ) |
| inline static

Is this station tile a rail waypoint?

Parameters

  t | the tile to get the information from

Precondition
  IsTileType(t, MP_STATION)

Returns
  true if and only if the tile is a rail waypoint

Definition at line 114 of file station_map.h.

References GetStationType().

Referenced by HasStationRail(), IsRailWaypointTile(), and IsValidTileForWaypoint().

## ◆ IsRailWaypointTile()

static bool IsRailWaypointTile | ( | TileIndex | t | ) |
| inline static

Is this tile a station tile and a rail waypoint?

Parameters

  t | the tile to get the information from

Returns
  true if and only if the tile is a rail waypoint

Definition at line 124 of file station_map.h.

References IsRailWaypoint(), IsTileType(), and MP_STATION.

Referenced by GetAxisForNewWaypoint(), GetOrderCmdFromTile(), and Waypoint::TileBelongsToRailStation().

## ◆ IsRoadStop()

static bool IsRoadStop | ( | TileIndex | t | ) |
| inline static

Is the station at t a road station?

Parameters

  t | Tile to check

Precondition
  IsTileType(t, MP_STATION)

Returns
  `true` if station at the tile is a bus top or a truck stop, `false` otherwise

Definition at line 203 of file station_map.h.

Referenced by CheckFlatLandRoadStop(), and IsRoadStopTile().

## ◆ IsRoadStopTile()

static bool IsRoadStopTile | ( | TileIndex | t | ) |
| inline static

Is tile t a road stop station?

Parameters

  t | Tile to check

Returns
  `true` if the tile is a station tile and a road stop

Definition at line 214 of file station_map.h.

References IsRoadStop(), IsTileType(), and MP_STATION.

Referenced by GetAnyRoadBits(), IsDriveThroughStopTile(), and IsStandardRoadStopTile().

## ◆ IsStandardRoadStopTile()

static bool IsStandardRoadStopTile | ( | TileIndex | t | ) |
| inline static

Is tile t a standard (non-drive through) road stop station?

Parameters

  t | Tile to check

Returns
  `true` if the tile is a station tile and a standard road stop

Definition at line 224 of file station_map.h.

References GetStationGfx(), GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET, and IsRoadStopTile().

Referenced by CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanEnterNewTile(), CanEnterTileOwnerCheck(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanExitOldTile(), RoadStop::Enter(), RoadStop::GetNextRoadStop(), GetTileSingleEntry(), GetTownRoadBits(), RoadVehicle::GetVehicleTrackdir(), RoadStop::Leave(), BaseStation::PostDestructor(), and RoadFindPathToDest().

## ◆ IsTruckStop()

static bool IsTruckStop | ( | TileIndex | t | ) |
| inline static

Is the station at t a truck stop?

Parameters

  t | Tile to check

Precondition
  IsTileType(t, MP_STATION)

Returns
  `true` if station is a truck stop, `false` otherwise

Definition at line 181 of file station_map.h.

References GetStationType().

Referenced by CheckFlatLandRoadStop(), and RemoveRoadStop().

## ◆ MakeAirport()

static void MakeAirport | ( | TileIndex | t,
|  | Owner | o,
|  | StationID | sid,
|  | byte | section,
|  | WaterClass | wc
| ) |  |
| inline static

Make the given tile an airport tile.

Parameters

  t | the tile to make a airport
  o | the owner of the airport
  sid | the station to which this tile belongs
  section | the StationGfx to be used for this tile
  wc | the type of water on this tile

Definition at line 623 of file station_map.h.

References MakeStation().

## ◆ MakeBuoy()

static void MakeBuoy | ( | TileIndex | t,
|  | StationID | sid,
|  | WaterClass | wc
| ) |  |
| inline static

Make the given tile a buoy tile.

Parameters

  t | the tile to make a buoy
  sid | the station to which this tile belongs
  wc | the type of water on this tile

Definition at line 634 of file station_map.h.

References GetTileOwner(), and MakeStation().

## ◆ MakeDock()

static void MakeDock | ( | TileIndex | t,
|  | Owner | o,
|  | StationID | sid,
|  | DiagDirection | d,
|  | WaterClass | wc
| ) |  |
| inline static

Make the given tile a dock tile.

Parameters

  t | the tile to make a dock
  o | the owner of the dock
  sid | the station to which this tile belongs
  d | the direction of the dock
  wc | the type of water on this tile

Definition at line 650 of file station_map.h.

References MakeStation().

## ◆ MakeDriveThroughRoadStop()

static void MakeDriveThroughRoadStop | ( | TileIndex | t,
|  | Owner | station,
|  | Owner | road,
|  | Owner | tram,
|  | StationID | sid,
|  | RoadStopType | rst,
|  | RoadTypes | rt,
|  | Axis | a
| ) |  |
| inline static

Make the given tile a drivethrough roadstop tile.

Parameters

  t | the tile to make a roadstop
  station | the owner of the roadstop
  road | the owner of the road
  tram | the owner of the tram
  sid | the station to which this tile belongs
  rst | the type of roadstop to make this tile
  rt | the roadtypes on this tile
  a | the direction of the roadstop

Definition at line 607 of file station_map.h.

References MakeStation(), and ROADSTOP_BUS.

## ◆ MakeOilrig()

static void MakeOilrig | ( | TileIndex | t,
|  | StationID | sid,
|  | WaterClass | wc
| ) |  |
| inline static

Make the given tile an oilrig tile.

Parameters

  t | the tile to make an oilrig
  sid | the station to which this tile belongs
  wc | the type of water on this tile

Definition at line 662 of file station_map.h.

References MakeStation(), and OWNER_NONE.

## ◆ MakeRailStation()

static void MakeRailStation | ( | TileIndex | t,
|  | Owner | o,
|  | StationID | sid,
|  | Axis | a,
|  | byte | section,
|  | RailType | rt
| ) |  |
| inline static

Make the given tile a rail station tile.

Parameters

  t | the tile to make a rail station tile
  o | the owner of the station
  sid | the station to which this tile belongs
  a | the axis of this tile
  section | the StationGfx to be used for this tile
  rt | the railtype of this tile

Definition at line 556 of file station_map.h.

References MakeStation().

## ◆ MakeRailWaypoint()

static void MakeRailWaypoint | ( | TileIndex | t,
|  | Owner | o,
|  | StationID | sid,
|  | Axis | a,
|  | byte | section,
|  | RailType | rt
| ) |  |
| inline static

Make the given tile a rail waypoint tile.

Parameters

  t | the tile to make a rail waypoint
  o | the owner of the waypoint
  sid | the waypoint to which this tile belongs
  a | the axis of this tile
  section | the StationGfx to be used for this tile
  rt | the railtype of this tile

Definition at line 572 of file station_map.h.

References MakeStation().

## ◆ MakeRoadStop()

static void MakeRoadStop | ( | TileIndex | t,
|  | Owner | o,
|  | StationID | sid,
|  | RoadStopType | rst,
|  | RoadTypes | rt,
|  | DiagDirection | d
| ) |  |
| inline static

Make the given tile a roadstop tile.

Parameters

  t | the tile to make a roadstop
  o | the owner of the roadstop
  sid | the station to which this tile belongs
  rst | the type of roadstop to make this tile
  rt | the roadtypes on this tile
  d | the direction of the roadstop

Definition at line 588 of file station_map.h.

References MakeStation(), and ROADSTOP_BUS.

## ◆ MakeStation()

static void MakeStation | ( | TileIndex | t,
|  | Owner | o,
|  | StationID | sid,
|  | StationType | st,
|  | byte | section,
|  | WaterClass | wc = `WATER_CLASS_INVALID`
| ) |  |
| inline static

Make the given tile a station tile.

Parameters

  t | the tile to make a station tile
  o | the owner of the station
  sid | the station to which this tile belongs
  st | the type this station tile
  section | the StationGfx to be used for this tile
  wc | The water class of the station

Definition at line 533 of file station_map.h.

References _m, _me, Tile::m2, Tile::m3, Tile::m4, Tile::m5, TileExtended::m7, MP_STATION, SB(), SetTileOwner(), SetTileType(), and SetWaterClass().

Referenced by MakeAirport(), MakeBuoy(), MakeDock(), MakeDriveThroughRoadStop(), MakeOilrig(), MakeRailStation(), MakeRailWaypoint(), and MakeRoadStop().

## ◆ SetCustomStationSpecIndex()

static void SetCustomStationSpecIndex | ( | TileIndex | t,
|  | byte | specindex
| ) |  |
| inline static

Set the custom station spec for this tile.

Parameters

  t | Tile to set the stationspec of.
  specindex | The new spec.

Precondition
  HasStationTileRail(t)

Definition at line 482 of file station_map.h.

## ◆ SetRailStationReservation()

static void SetRailStationReservation | ( | TileIndex | t,
|  | bool | b
| ) |  |
| inline static

Set the reservation state of the rail station.

Precondition
  HasStationRail(t)

Parameters

  t | the station tile
  b | the reservation state

Definition at line 406 of file station_map.h.

Referenced by NPFSaveTargetData(), CYapfReserveTrack< Types >::ReserveRailStationPlatform(), and CYapfReserveTrack< Types >::UnreserveSingleTrack().

## ◆ SetStationGfx()

static void SetStationGfx | ( | TileIndex | t,
|  | StationGfx | gfx
| ) |  |
| inline static

Set the station graphics of this tile.

Parameters

  t | the tile to update
  gfx | the new graphics

Precondition
  IsTileType(t, MP_STATION)

Definition at line 81 of file station_map.h.

## ◆ SetStationTileRandomBits()

static void SetStationTileRandomBits | ( | TileIndex | t,
|  | byte | random_bits
| ) |  |
| inline static

Set the random bits for a station tile.

Parameters

  t | Tile to set random bits for.
  random_bits | The random bits.

Precondition
  IsTileType(t, MP_STATION)

Definition at line 506 of file station_map.h.