OpenTTD Source  14.0-beta1
station_map.h File Reference
#include "rail_map.h"
#include "road_map.h"
#include "water_map.h"
#include "station_func.h"
#include "rail.h"
#include "road.h"

Go to the source code of this file.

Typedefs

typedef byte StationGfx
 Index of station graphics. More...
 

Functions

StationID GetStationIndex (Tile t)
 Get StationID from a tile. More...
 
StationType GetStationType (Tile t)
 Get the station type of this tile. More...
 
RoadStopType GetRoadStopType (Tile t)
 Get the road stop type of this tile. More...
 
StationGfx GetStationGfx (Tile t)
 Get the station graphics of this tile. More...
 
void SetStationGfx (Tile t, StationGfx gfx)
 Set the station graphics of this tile. More...
 
bool IsRailStation (Tile t)
 Is this station tile a rail station? More...
 
bool IsRailStationTile (Tile t)
 Is this tile a station tile and a rail station? More...
 
bool IsRailWaypoint (Tile t)
 Is this station tile a rail waypoint? More...
 
bool IsRailWaypointTile (Tile t)
 Is this tile a station tile and a rail waypoint? More...
 
bool HasStationRail (Tile t)
 Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint? More...
 
bool HasStationTileRail (Tile t)
 Has this station tile a rail? In other words, is this station tile a rail station or rail waypoint? More...
 
bool IsAirport (Tile t)
 Is this station tile an airport? More...
 
bool IsAirportTile (Tile t)
 Is this tile a station tile and an airport tile? More...
 
bool IsHangar (Tile t)
 Check whether the given tile is a hangar. More...
 
bool IsTruckStop (Tile t)
 Is the station at t a truck stop? More...
 
bool IsBusStop (Tile t)
 Is the station at t a bus stop? More...
 
bool IsRoadStop (Tile t)
 Is the station at t a road station? More...
 
bool IsRoadStopTile (Tile t)
 Is tile t a road stop station? More...
 
bool IsBayRoadStopTile (Tile t)
 Is tile t a bay (non-drive through) road stop station? More...
 
bool IsDriveThroughStopTile (Tile t)
 Is tile t a drive through road stop station? More...
 
StationGfx GetTranslatedAirportTileID (StationGfx gfx)
 Do airporttile gfx ID translation for NewGRFs. More...
 
StationGfx GetAirportGfx (Tile t)
 Get the station graphics of this airport tile. More...
 
DiagDirection GetRoadStopDir (Tile t)
 Gets the direction the road stop entrance points towards. More...
 
bool IsOilRig (Tile t)
 Is tile t part of an oilrig? More...
 
bool IsDock (Tile t)
 Is tile t a dock tile? More...
 
bool IsDockTile (Tile t)
 Is tile t a dock tile? More...
 
bool IsBuoy (Tile t)
 Is tile t a buoy tile? More...
 
bool IsBuoyTile (Tile t)
 Is tile t a buoy tile? More...
 
bool IsHangarTile (Tile t)
 Is tile t an hangar tile? More...
 
bool IsStationTileBlocked (Tile t)
 Is tile t a blocked tile? More...
 
void SetStationTileBlocked (Tile t, bool b)
 Set the blocked state of the rail station. More...
 
bool CanStationTileHaveWires (Tile t)
 Can tile t have catenary wires? More...
 
void SetStationTileHaveWires (Tile t, bool b)
 Set the catenary wires state of the rail station. More...
 
bool CanStationTileHavePylons (Tile t)
 Can tile t have catenary pylons? More...
 
void SetStationTileHavePylons (Tile t, bool b)
 Set the catenary pylon state of the rail station. More...
 
Axis GetRailStationAxis (Tile t)
 Get the rail direction of a rail station. More...
 
Track GetRailStationTrack (Tile t)
 Get the rail track of a rail station tile. More...
 
TrackBits GetRailStationTrackBits (Tile t)
 Get the trackbits of a rail station tile. More...
 
bool IsCompatibleTrainStationTile (Tile test_tile, Tile station_tile)
 Check if a tile is a valid continuation to a railstation tile. More...
 
bool HasStationReservation (Tile t)
 Get the reservation state of the rail station. More...
 
void SetRailStationReservation (Tile t, bool b)
 Set the reservation state of the rail station. More...
 
TrackBits GetStationReservationTrackBits (Tile t)
 Get the reserved track bits for a waypoint. More...
 
DiagDirection GetDockDirection (Tile t)
 Get the direction of a dock. More...
 
bool IsDockWaterPart (Tile t)
 Check whether a dock tile is the tile on water.
 
bool IsCustomStationSpecIndex (Tile t)
 Is there a custom rail station spec on this tile? More...
 
void SetCustomStationSpecIndex (Tile t, byte specindex)
 Set the custom station spec for this tile. More...
 
uint GetCustomStationSpecIndex (Tile t)
 Get the custom station spec for this tile. More...
 
bool IsCustomRoadStopSpecIndex (Tile t)
 Is there a custom road stop spec on this tile? More...
 
void SetCustomRoadStopSpecIndex (Tile t, byte specindex)
 Set the custom road stop spec for this tile. More...
 
uint GetCustomRoadStopSpecIndex (Tile t)
 Get the custom road stop spec for this tile. More...
 
void SetStationTileRandomBits (Tile t, byte random_bits)
 Set the random bits for a station tile. More...
 
byte GetStationTileRandomBits (Tile t)
 Get the random bits of a station tile. More...
 
void MakeStation (Tile t, Owner o, StationID sid, StationType st, byte section, WaterClass wc=WATER_CLASS_INVALID)
 Make the given tile a station tile. More...
 
void MakeRailStation (Tile t, Owner o, StationID sid, Axis a, byte section, RailType rt)
 Make the given tile a rail station tile. More...
 
void MakeRailWaypoint (Tile t, Owner o, StationID sid, Axis a, byte section, RailType rt)
 Make the given tile a rail waypoint tile. More...
 
void MakeRoadStop (Tile t, Owner o, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, DiagDirection d)
 Make the given tile a roadstop tile. More...
 
void MakeDriveThroughRoadStop (Tile t, Owner station, Owner road, Owner tram, StationID sid, RoadStopType rst, RoadType road_rt, RoadType tram_rt, Axis a)
 Make the given tile a drivethrough roadstop tile. More...
 
void MakeAirport (Tile t, Owner o, StationID sid, byte section, WaterClass wc)
 Make the given tile an airport tile. More...
 
void MakeBuoy (Tile t, StationID sid, WaterClass wc)
 Make the given tile a buoy tile. More...
 
void MakeDock (Tile t, Owner o, StationID sid, DiagDirection d, WaterClass wc)
 Make the given tile a dock tile. More...
 
void MakeOilrig (Tile 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 20 of file station_map.h.

Function Documentation

◆ CanStationTileHavePylons()

bool CanStationTileHavePylons ( Tile  t)
inline

Can tile t have catenary pylons?

Precondition
HasStationRail(t)
Parameters
tTile to check
Returns
true if the tile can have catenary pylons

Definition at line 386 of file station_map.h.

References HasBit(), HasStationRail(), and Tile::m6().

◆ CanStationTileHaveWires()

bool CanStationTileHaveWires ( Tile  t)
inline

Can tile t have catenary wires?

Precondition
HasStationRail(t)
Parameters
tTile to check
Returns
true if the tile can have catenary wires

Definition at line 362 of file station_map.h.

References HasBit(), HasStationRail(), and Tile::m6().

Referenced by MaskWireBits().

◆ GetAirportGfx()

StationGfx GetAirportGfx ( Tile  t)
inline

Get the station graphics of this airport tile.

Parameters
tthe tile to query
Precondition
IsAirport(t)
Returns
the station graphics

Definition at line 246 of file station_map.h.

References GetStationGfx(), GetTranslatedAirportTileID(), and IsAirport().

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

◆ GetCustomRoadStopSpecIndex()

uint GetCustomRoadStopSpecIndex ( Tile  t)
inline

Get the custom road stop spec for this tile.

Parameters
tTile to query
Precondition
IsRoadStopTile(t)
Returns
The custom station spec of this tile.

Definition at line 585 of file station_map.h.

References GB(), IsRoadStopTile(), and Tile::m8().

◆ GetCustomStationSpecIndex()

uint GetCustomStationSpecIndex ( Tile  t)
inline

Get the custom station spec for this tile.

Parameters
tTile to query
Precondition
HasStationTileRail(t)
Returns
The custom station spec of this tile.

Definition at line 549 of file station_map.h.

References HasStationTileRail(), and Tile::m4().

Referenced by FindRailStationEnd().

◆ GetDockDirection()

DiagDirection GetDockDirection ( Tile  t)
inline

Get the direction of a dock.

Parameters
tTile 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 502 of file station_map.h.

References GetStationGfx(), GFX_DOCK_BASE_WATER_PART, and IsDock().

Referenced by FindDockLandPart(), and RemoveDock().

◆ GetRailStationAxis()

Axis GetRailStationAxis ( Tile  t)
inline

Get the rail direction of a rail station.

Parameters
tTile to query
Precondition
HasStationRail(t)
Returns
The direction of the rails on tile t.

Definition at line 410 of file station_map.h.

References AXIS_X, AXIS_Y, GetStationGfx(), HasBit(), and HasStationRail().

Referenced by FindRailStationEnd(), GetAxisForNewWaypoint(), Station::GetPlatformLength(), GetRailStationTrack(), GetRailStationTrackBits(), IsCompatibleTrainStationTile(), MaskWireBits(), and SetRailStationPlatformReservation().

◆ GetRailStationTrack()

Track GetRailStationTrack ( Tile  t)
inline

Get the rail track of a rail station tile.

Parameters
tTile to query
Precondition
HasStationRail(t)
Returns
The rail track of the rails on tile t.

Definition at line 422 of file station_map.h.

References AxisToTrack(), and GetRailStationAxis().

Referenced by CmdConvertRail(), and GetRailTrackBitsUniversal().

◆ GetRailStationTrackBits()

TrackBits GetRailStationTrackBits ( Tile  t)
inline

Get the trackbits of a rail station tile.

Parameters
tTile to query
Precondition
HasStationRail(t)
Returns
The trackbits of the rails on tile t.

Definition at line 433 of file station_map.h.

References AxisToTrackBits(), and GetRailStationAxis().

Referenced by GetStationReservationTrackBits().

◆ GetRoadStopDir()

◆ GetRoadStopType()

RoadStopType GetRoadStopType ( Tile  t)
inline

Get the road stop type of this tile.

Parameters
tthe tile to query
Precondition
GetStationType(t) == STATION_TRUCK || GetStationType(t) == STATION_BUS
Returns
the road stop type

Definition at line 56 of file station_map.h.

References GetStationType().

Referenced by RoadStop::ClearDriveThrough(), CmdRemoveRoadStop(), RoadStop::MakeDriveThrough(), and CYapfCostRoadT< Types >::OneTileCost().

◆ GetStationGfx()

StationGfx GetStationGfx ( Tile  t)
inline

Get the station graphics of this tile.

Parameters
tthe tile to query
Precondition
IsTileType(t, MP_STATION)
Returns
the station graphics

Definition at line 68 of file station_map.h.

References IsTileType(), Tile::m5(), and MP_STATION.

Referenced by FindDockLandPart(), GetAirportGfx(), GetDockDirection(), GetRailStationAxis(), GetRoadStopDir(), IsBayRoadStopTile(), IsDockWaterPart(), and IsDriveThroughStopTile().

◆ GetStationIndex()

◆ GetStationReservationTrackBits()

TrackBits GetStationReservationTrackBits ( Tile  t)
inline

Get the reserved track bits for a waypoint.

Precondition
HasStationRail(t)
Parameters
tthe tile
Returns
reserved track bits

Definition at line 490 of file station_map.h.

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

Referenced by GetReservedTrackbits().

◆ GetStationTileRandomBits()

byte GetStationTileRandomBits ( Tile  t)
inline

Get the random bits of a station tile.

Parameters
tTile to query
Precondition
IsTileType(t, MP_STATION)
Returns
The random bits for this station tile.

Definition at line 609 of file station_map.h.

References GB(), IsTileType(), Tile::m3(), and MP_STATION.

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

◆ GetStationType()

StationType GetStationType ( Tile  t)
inline

Get the station type of this tile.

Parameters
tthe tile to query
Precondition
IsTileType(t, MP_STATION)
Returns
the station type

Definition at line 44 of file station_map.h.

References GB(), IsTileType(), Tile::m6(), and MP_STATION.

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

◆ GetTranslatedAirportTileID()

StationGfx GetTranslatedAirportTileID ( StationGfx  gfx)

Do airporttile gfx ID translation for NewGRFs.

Parameters
gfxthe type to get the override for.
Returns
the gfx to actually work with.

Definition at line 96 of file newgrf_airporttiles.cpp.

References AirportTileSpec::Get(), AirportTileSpec::grf_prop, INVALID_AIRPORTTILE, and GRFFileProps::override.

Referenced by GetAirportGfx().

◆ HasStationRail()

bool HasStationRail ( Tile  t)
inline

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

Parameters
tthe tile to check
Precondition
IsTileType(t, MP_STATION)
Returns
true if and only if the tile has rail

Definition at line 135 of file station_map.h.

References IsRailStation(), and IsRailWaypoint().

Referenced by CanStationTileHavePylons(), CanStationTileHaveWires(), CmdConvertRail(), FindRailStationEnd(), GetRailStationAxis(), GetRailTrackBitsUniversal(), GetReservedTrackbits(), GetTileRailType(), HasStationReservation(), HasStationTileRail(), IsStationTileBlocked(), SetRailStationReservation(), SetStationTileBlocked(), SetStationTileHavePylons(), SetStationTileHaveWires(), TryReserveRailTrack(), and UnreserveRailTrack().

◆ HasStationReservation()

bool HasStationReservation ( Tile  t)
inline

Get the reservation state of the rail station.

Precondition
HasStationRail(t)
Parameters
tthe station tile
Returns
reservation state

Definition at line 466 of file station_map.h.

References HasBit(), HasStationRail(), and Tile::m6().

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

◆ HasStationTileRail()

bool HasStationTileRail ( Tile  t)
inline

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

Parameters
tthe tile to check
Returns
true if and only if the tile is a station tile and has rail

Definition at line 146 of file station_map.h.

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

Referenced by CanEnterTileOwnerCheck(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::FollowTileExit(), GetCustomStationSpecIndex(), IsCustomStationSpecIndex(), MaskWireBits(), RemoveFromRailBaseStation(), and SetCustomStationSpecIndex().

◆ IsAirport()

bool IsAirport ( Tile  t)
inline

Is this station tile an airport?

Parameters
tthe 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 157 of file station_map.h.

References GetStationType().

Referenced by GetAirportGfx(), GetNearbyAirportTileInformation(), IsAirportTile(), and IsHangar().

◆ IsAirportTile()

bool IsAirportTile ( Tile  t)
inline

Is this tile a station tile and an airport tile?

Parameters
tthe tile to get the information from
Returns
true if and only if the tile is an airport

Definition at line 167 of file station_map.h.

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

Referenced by FloodVehicleProc(), and FloodVehicles().

◆ IsBayRoadStopTile()

◆ IsBuoy()

bool IsBuoy ( Tile  t)
inline

Is tile t a buoy tile?

Parameters
tTile 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()

bool IsBuoyTile ( Tile  t)
inline

Is tile t a buoy tile?

Parameters
tTile 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()

bool IsBusStop ( Tile  t)
inline

Is the station at t a bus stop?

Parameters
tTile to check
Precondition
IsTileType(t, MP_STATION)
Returns
true if station is a bus stop, false otherwise

Definition at line 191 of file station_map.h.

References GetStationType().

Referenced by IsRoadStop().

◆ IsCompatibleTrainStationTile()

bool IsCompatibleTrainStationTile ( Tile  test_tile,
Tile  station_tile 
)
inline

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_tileTile to test
    station_tileStation tile to compare with
    Precondition
    IsRailStationTile(station_tile)
    Returns
    true if the two tiles are compatible

Definition at line 451 of file station_map.h.

References GetRailStationAxis(), GetRailType(), GetStationIndex(), IsCompatibleRail(), IsRailStationTile(), and IsStationTileBlocked().

Referenced by ClearPathReservation(), FollowTrainReservation(), Station::GetPlatformLength(), GetTrainForReservation(), CYapfReserveTrack< Types >::ReserveRailStationPlatform(), SetRailStationPlatformReservation(), and CYapfReserveTrack< Types >::UnreserveSingleTrack().

◆ IsCustomRoadStopSpecIndex()

bool IsCustomRoadStopSpecIndex ( Tile  t)
inline

Is there a custom road stop spec on this tile?

Parameters
tTile to query
Precondition
IsRoadStopTile(t)
Returns
True if this station is part of a newgrf station.

Definition at line 561 of file station_map.h.

References GB(), IsRoadStopTile(), and Tile::m8().

◆ IsCustomStationSpecIndex()

bool IsCustomStationSpecIndex ( Tile  t)
inline

Is there a custom rail station spec on this tile?

Parameters
tTile to query
Precondition
HasStationTileRail(t)
Returns
True if this station is part of a newgrf station.

Definition at line 525 of file station_map.h.

References HasStationTileRail(), and Tile::m4().

◆ IsDock()

bool IsDock ( Tile  t)
inline

Is tile t a dock tile?

Parameters
tTile 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().

Referenced by GetDockDirection().

◆ IsDockTile()

bool IsDockTile ( Tile  t)
inline

Is tile t a dock tile?

Parameters
tTile 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.

Referenced by CheckForDockingTile(), FindDockLandPart(), IsDockWaterPart(), IsShipDestinationTile(), and RemoveDock().

◆ IsDriveThroughStopTile()

bool IsDriveThroughStopTile ( Tile  t)
inline

Is tile t a drive through road stop station?

Parameters
tTile to check
Returns
true if the tile is a station tile and a drive through road stop

Definition at line 233 of file station_map.h.

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

Referenced by AfterLoadRoadStops(), CanFollowRoad(), CanRoadContinueIntoNextTile(), CheckFlatLandRoadStop(), CmdRemoveRoadStop(), GetAnyRoadBits(), RoadStop::IsDriveThroughRoadStopContinuation(), CYapfCostRoadT< Types >::OneTileCost(), and RemoveRoadStop().

◆ IsHangar()

bool IsHangar ( Tile  t)

Check whether the given tile is a hangar.

Parameters
tthe 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 89 of file station_cmd.cpp.

References Station::airport, SpecializedStation< Station, false >::GetByTile(), Airport::GetHangarTile(), Airport::GetSpec(), IsAirport(), IsTileType(), MP_STATION, and AirportSpec::nof_depots.

Referenced by IsHangarTile().

◆ IsHangarTile()

bool IsHangarTile ( Tile  t)
inline

Is tile t an hangar tile?

Parameters
tTile 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(), and Aircraft::IsInDepot().

◆ IsOilRig()

bool IsOilRig ( Tile  t)
inline

Is tile t part of an oilrig?

Parameters
tTile 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().

Referenced by CheckForDockingTile(), and IsShipDestinationTile().

◆ IsRailStation()

bool IsRailStation ( Tile  t)
inline

Is this station tile a rail station?

Parameters
tthe 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 92 of file station_map.h.

References GetStationType().

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

◆ IsRailStationTile()

◆ IsRailWaypoint()

bool IsRailWaypoint ( Tile  t)
inline

Is this station tile a rail waypoint?

Parameters
tthe 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 113 of file station_map.h.

References GetStationType().

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

◆ IsRailWaypointTile()

bool IsRailWaypointTile ( Tile  t)
inline

Is this tile a station tile and a rail waypoint?

Parameters
tthe tile to get the information from
Returns
true if and only if the tile is a rail waypoint

Definition at line 123 of file station_map.h.

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

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

◆ IsRoadStop()

bool IsRoadStop ( Tile  t)
inline

Is the station at t a road station?

Parameters
tTile 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 202 of file station_map.h.

References IsBusStop(), IsTileType(), IsTruckStop(), and MP_STATION.

Referenced by CalculateRoadStopCost(), CanRoadContinueIntoNextTile(), CheckFlatLandRoadStop(), CmdRemoveRoadStop(), and IsRoadStopTile().

◆ IsRoadStopTile()

bool IsRoadStopTile ( Tile  t)
inline

◆ IsStationTileBlocked()

bool IsStationTileBlocked ( Tile  t)
inline

Is tile t a blocked tile?

Precondition
HasStationRail(t)
Parameters
tTile to check
Returns
true if the tile is blocked

Definition at line 338 of file station_map.h.

References HasBit(), HasStationRail(), and Tile::m6().

Referenced by CmdConvertRail(), and IsCompatibleTrainStationTile().

◆ IsTruckStop()

bool IsTruckStop ( Tile  t)
inline

Is the station at t a truck stop?

Parameters
tTile to check
Precondition
IsTileType(t, MP_STATION)
Returns
true if station is a truck stop, false otherwise

Definition at line 180 of file station_map.h.

References GetStationType().

Referenced by CheckFlatLandRoadStop(), IsRoadStop(), and RemoveRoadStop().

◆ MakeAirport()

void MakeAirport ( Tile  t,
Owner  o,
StationID  sid,
byte  section,
WaterClass  wc 
)
inline

Make the given tile an airport tile.

Parameters
tthe tile to make a airport
othe owner of the airport
sidthe station to which this tile belongs
sectionthe StationGfx to be used for this tile
wcthe type of water on this tile

Definition at line 718 of file station_map.h.

References MakeStation().

◆ MakeBuoy()

void MakeBuoy ( Tile  t,
StationID  sid,
WaterClass  wc 
)
inline

Make the given tile a buoy tile.

Parameters
tthe tile to make a buoy
sidthe station to which this tile belongs
wcthe type of water on this tile

Definition at line 729 of file station_map.h.

References GetTileOwner(), and MakeStation().

◆ MakeDock()

void MakeDock ( Tile  t,
Owner  o,
StationID  sid,
DiagDirection  d,
WaterClass  wc 
)
inline

Make the given tile a dock tile.

Parameters
tthe tile to make a dock
othe owner of the dock
sidthe station to which this tile belongs
dthe direction of the dock
wcthe type of water on this tile

Definition at line 745 of file station_map.h.

References MakeStation().

◆ MakeDriveThroughRoadStop()

void MakeDriveThroughRoadStop ( Tile  t,
Owner  station,
Owner  road,
Owner  tram,
StationID  sid,
RoadStopType  rst,
RoadType  road_rt,
RoadType  tram_rt,
Axis  a 
)
inline

Make the given tile a drivethrough roadstop tile.

Parameters
tthe tile to make a roadstop
stationthe owner of the roadstop
roadthe owner of the road
tramthe owner of the tram
sidthe station to which this tile belongs
rstthe type of roadstop to make this tile
road_rtthe road roadtype on this tile
tram_rtthe tram roadtype on this tile
athe direction of the roadstop

Definition at line 702 of file station_map.h.

References MakeStation(), and ROADSTOP_BUS.

◆ MakeOilrig()

void MakeOilrig ( Tile  t,
StationID  sid,
WaterClass  wc 
)
inline

Make the given tile an oilrig tile.

Parameters
tthe tile to make an oilrig
sidthe station to which this tile belongs
wcthe type of water on this tile

Definition at line 757 of file station_map.h.

References MakeStation(), and OWNER_NONE.

◆ MakeRailStation()

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

Make the given tile a rail station tile.

Parameters
tthe tile to make a rail station tile
othe owner of the station
sidthe station to which this tile belongs
athe axis of this tile
sectionthe StationGfx to be used for this tile
rtthe railtype of this tile

Definition at line 649 of file station_map.h.

References MakeStation().

◆ MakeRailWaypoint()

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

Make the given tile a rail waypoint tile.

Parameters
tthe tile to make a rail waypoint
othe owner of the waypoint
sidthe waypoint to which this tile belongs
athe axis of this tile
sectionthe StationGfx to be used for this tile
rtthe railtype of this tile

Definition at line 665 of file station_map.h.

References MakeStation().

Referenced by MoveWaypointsToBaseStations().

◆ MakeRoadStop()

void MakeRoadStop ( Tile  t,
Owner  o,
StationID  sid,
RoadStopType  rst,
RoadType  road_rt,
RoadType  tram_rt,
DiagDirection  d 
)
inline

Make the given tile a roadstop tile.

Parameters
tthe tile to make a roadstop
othe owner of the roadstop
sidthe station to which this tile belongs
rstthe type of roadstop to make this tile
road_rtthe road roadtype on this tile
tram_rtthe tram roadtype on this tile
dthe direction of the roadstop

Definition at line 682 of file station_map.h.

References MakeStation(), and ROADSTOP_BUS.

◆ MakeStation()

void MakeStation ( Tile  t,
Owner  o,
StationID  sid,
StationType  st,
byte  section,
WaterClass  wc = WATER_CLASS_INVALID 
)
inline

Make the given tile a station tile.

Parameters
tthe tile to make a station tile
othe owner of the station
sidthe station to which this tile belongs
stthe type this station tile
sectionthe StationGfx to be used for this tile
wcThe water class of the station

Definition at line 624 of file station_map.h.

References Tile::m2(), Tile::m3(), Tile::m4(), Tile::m5(), Tile::m6(), Tile::m7(), Tile::m8(), MP_STATION, SB(), SetDockingTile(), SetTileOwner(), SetTileType(), and SetWaterClass().

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

◆ SetCustomRoadStopSpecIndex()

void SetCustomRoadStopSpecIndex ( Tile  t,
byte  specindex 
)
inline

Set the custom road stop spec for this tile.

Parameters
tTile to set the stationspec of.
specindexThe new spec.
Precondition
IsRoadStopTile(t)

Definition at line 573 of file station_map.h.

References IsRoadStopTile(), Tile::m8(), and SB().

◆ SetCustomStationSpecIndex()

void SetCustomStationSpecIndex ( Tile  t,
byte  specindex 
)
inline

Set the custom station spec for this tile.

Parameters
tTile to set the stationspec of.
specindexThe new spec.
Precondition
HasStationTileRail(t)

Definition at line 537 of file station_map.h.

References HasStationTileRail(), and Tile::m4().

Referenced by MoveWaypointsToBaseStations().

◆ SetRailStationReservation()

void SetRailStationReservation ( Tile  t,
bool  b 
)
inline

Set the reservation state of the rail station.

Precondition
HasStationRail(t)
Parameters
tthe station tile
bthe reservation state

Definition at line 478 of file station_map.h.

References HasStationRail(), Tile::m6(), and SB().

Referenced by MoveWaypointsToBaseStations(), NPFSaveTargetData(), CYapfReserveTrack< Types >::ReserveRailStationPlatform(), SetRailStationPlatformReservation(), TryReserveRailTrack(), UnreserveRailTrack(), and CYapfReserveTrack< Types >::UnreserveSingleTrack().

◆ SetStationGfx()

void SetStationGfx ( Tile  t,
StationGfx  gfx 
)
inline

Set the station graphics of this tile.

Parameters
tthe tile to update
gfxthe new graphics
Precondition
IsTileType(t, MP_STATION)

Definition at line 80 of file station_map.h.

References IsTileType(), Tile::m5(), and MP_STATION.

◆ SetStationTileBlocked()

void SetStationTileBlocked ( Tile  t,
bool  b 
)
inline

Set the blocked state of the rail station.

Precondition
HasStationRail(t)
Parameters
tthe station tile
bthe blocked state

Definition at line 350 of file station_map.h.

References HasStationRail(), Tile::m6(), and SB().

◆ SetStationTileHavePylons()

void SetStationTileHavePylons ( Tile  t,
bool  b 
)
inline

Set the catenary pylon state of the rail station.

Precondition
HasStationRail(t)
Parameters
tthe station tile
bthe catenary pylons state

Definition at line 398 of file station_map.h.

References HasStationRail(), Tile::m6(), and SB().

◆ SetStationTileHaveWires()

void SetStationTileHaveWires ( Tile  t,
bool  b 
)
inline

Set the catenary wires state of the rail station.

Precondition
HasStationRail(t)
Parameters
tthe station tile
bthe catenary wires state

Definition at line 374 of file station_map.h.

References HasStationRail(), Tile::m6(), and SB().

◆ SetStationTileRandomBits()

void SetStationTileRandomBits ( Tile  t,
byte  random_bits 
)
inline

Set the random bits for a station tile.

Parameters
tTile to set random bits for.
random_bitsThe random bits.
Precondition
IsTileType(t, MP_STATION)

Definition at line 597 of file station_map.h.

References IsTileType(), Tile::m3(), MP_STATION, and SB().