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.

Functions

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

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

typedef byte StationGfx

Index of station graphics.

See Also
_station_display_datas

Definition at line 21 of file station_map.h.

Function Documentation

static StationGfx GetAirportGfx ( TileIndex  t)
inlinestatic

Get the station graphics of this airport tile.

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

Definition at line 245 of file station_map.h.

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

Referenced by GetAirportTileIDAtOffset(), and AirportTileSpec::GetByTile().

static uint GetCustomStationSpecIndex ( TileIndex  t)
inlinestatic

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 494 of file station_map.h.

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

Referenced by CmdBuildRailStation(), CmdBuildRailWaypoint(), DeallocateSpecFromStation(), FindRailStationEnd(), StationScopeResolver::GetVariable(), and RemoveFromRailBaseStation().

static DiagDirection GetDockDirection ( TileIndex  t)
inlinestatic

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 430 of file station_map.h.

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

Referenced by GetDockOffset(), and RemoveDock().

static TileIndexDiffC GetDockOffset ( TileIndex  t)
inlinestatic

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

Parameters
tTile 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, GetDockDirection(), IsBuoy(), IsDock(), IsOilRig(), IsTileType(), and MP_STATION.

Referenced by Ship::GetOrderStationLocation(), and RemoveDock().

static Axis GetRailStationAxis ( TileIndex  t)
inlinestatic

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 338 of file station_map.h.

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

Referenced by CmdBuildRailStation(), ExploreSegment(), FindRailStationEnd(), GetAxisForNewWaypoint(), GetNearbyTile(), Station::GetPlatformLength(), GetRailStationTrack(), GetRailStationTrackBits(), StationScopeResolver::GetVariable(), IsCompatibleTrainStationTile(), MaskWireBits(), and SetRailStationPlatformReservation().

static Track GetRailStationTrack ( TileIndex  t)
inlinestatic

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 350 of file station_map.h.

References AxisToTrack(), and GetRailStationAxis().

Referenced by CmdConvertRail(), GetRailTrackBitsUniversal(), CYapfDestinationTileOrStationRailT< Types >::PfDetectDestination(), and RemoveFromRailBaseStation().

static TrackBits GetRailStationTrackBits ( TileIndex  t)
inlinestatic

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 361 of file station_map.h.

References AxisToTrackBits(), and GetRailStationAxis().

Referenced by GetStationReservationTrackBits().

static DiagDirection GetRoadStopDir ( TileIndex  t)
inlinestatic
static RoadStopType GetRoadStopType ( TileIndex  t)
inlinestatic

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 57 of file station_map.h.

References GetStationType(), ROADSTOP_BUS, and ROADSTOP_TRUCK.

Referenced by RoadStop::ClearDriveThrough(), CmdRemoveRoadStop(), RoadVehicle::Crash(), DeleteLastRoadVeh(), RoadStop::MakeDriveThrough(), CYapfCostRoadT< Types >::OneTileCost(), Vehicle::PreDestructor(), and RoadFindPathToDest().

static StationGfx GetStationGfx ( TileIndex  t)
inlinestatic

Get the station graphics of this tile.

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

Definition at line 69 of file station_map.h.

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

Referenced by AfterLoadGame(), CanStationTileHavePylons(), CanStationTileHaveWires(), CmdBuildRailStation(), GetAirportGfx(), GetDockDirection(), GetRailStationAxis(), GetRoadStopDir(), StationScopeResolver::GetVariable(), IsDriveThroughStopTile(), IsStandardRoadStopTile(), and IsStationTileBlocked().

static StationID GetStationIndex ( TileIndex  t)
inlinestatic
static TrackBits GetStationReservationTrackBits ( TileIndex  t)
inlinestatic

Get the reserved track bits for a waypoint.

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

Definition at line 418 of file station_map.h.

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

Referenced by GetReservedTrackbits().

static byte GetStationTileRandomBits ( TileIndex  t)
inlinestatic

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 518 of file station_map.h.

References _m, GB(), IsTileType(), and MP_STATION.

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

static StationType GetStationType ( TileIndex  t)
inlinestatic

Get the station type of this tile.

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

Definition at line 45 of file station_map.h.

References _me, GB(), IsTileType(), and MP_STATION.

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

static bool HasStationRail ( TileIndex  t)
inlinestatic

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 136 of file station_map.h.

References IsRailStation(), and IsRailWaypoint().

Referenced by AfterLoadGame(), CmdConvertRail(), ExploreSegment(), FindRailStationEnd(), GetRailStationAxis(), GetRailTrackBitsUniversal(), GetReservedTrackbits(), GetTileRailType(), HasStationReservation(), HasStationTileRail(), SetRailStationReservation(), TryReserveRailTrack(), and UnreserveRailTrack().

static bool HasStationReservation ( TileIndex  t)
inlinestatic

Get the reservation state of the rail station.

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

Definition at line 394 of file station_map.h.

References _me, HasBit(), and HasStationRail().

Referenced by CmdBuildRailStation(), CmdBuildRailWaypoint(), FollowReservation(), GetStationReservationTrackBits(), StationScopeResolver::GetVariable(), CYapfCostRailT< Types >::IsAnyStationTileReserved(), RemoveFromRailBaseStation(), CYapfReserveTrack< Types >::ReserveRailStationPlatform(), and TryReserveRailTrack().

static bool HasStationTileRail ( TileIndex  t)
inlinestatic
static bool IsAirport ( TileIndex  t)
inlinestatic

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 158 of file station_map.h.

References GetStationType().

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

static bool IsAirportTile ( TileIndex  t)
inlinestatic

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 168 of file station_map.h.

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

Referenced by AfterLoadGame(), DisasterTick_Zeppeliner(), FloodVehicleProc(), and FloodVehicles().

static bool IsBuoy ( TileIndex  t)
inlinestatic

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 AfterLoadCompanyStats(), AfterLoadGame(), GetDockOffset(), IsBuoyTile(), and IsWateredTile().

static bool IsBuoyTile ( TileIndex  t)
inlinestatic

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 AfterLoadGame(), GetOrderCmdFromTile(), MoveBuoysToWaypoints(), and ResetLandscapeConfirmationCallback().

static bool IsBusStop ( TileIndex  t)
inlinestatic

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 192 of file station_map.h.

References GetStationType().

Referenced by IsRoadStop().

static bool IsCompatibleTrainStationTile ( TileIndex  test_tile,
TileIndex  station_tile 
)
inlinestatic

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 379 of file station_map.h.

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

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

static bool IsCustomStationSpecIndex ( TileIndex  t)
inlinestatic

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 470 of file station_map.h.

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

Referenced by StationScopeResolver::GetVariable().

static bool IsDock ( TileIndex  t)
inlinestatic

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 AfterLoadGame(), GetDockDirection(), GetDockOffset(), and IsWateredTile().

static bool IsDockTile ( TileIndex  t)
inlinestatic

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.

static bool IsDriveThroughStopTile ( TileIndex  t)
inlinestatic

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 234 of file station_map.h.

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

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

bool IsHangar ( TileIndex  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 74 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().

static bool IsHangarTile ( TileIndex  t)
inlinestatic

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(), IsDepotTypeTile(), Aircraft::IsInDepot(), RemoveAirport(), and OrderBackup::RemoveOrder().

static bool IsOilRig ( TileIndex  t)
inlinestatic

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 AfterLoadGame(), GetDockOffset(), and IsWateredTile().

static bool IsRailStation ( TileIndex  t)
inlinestatic

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 93 of file station_map.h.

References GetStationType().

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

static bool IsRailStationTile ( TileIndex  t)
inlinestatic
static bool IsRailWaypoint ( TileIndex  t)
inlinestatic

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 114 of file station_map.h.

References GetStationType().

Referenced by HasStationRail(), IsRailWaypointTile(), IsValidTileForWaypoint(), and CYapfCostRailT< Types >::PfCalcCost().

static bool IsRailWaypointTile ( TileIndex  t)
inlinestatic

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 124 of file station_map.h.

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

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

static bool IsRoadStop ( TileIndex  t)
inlinestatic

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 203 of file station_map.h.

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

Referenced by AfterLoadGame(), CheckFlatLandRoadStop(), CmdBuildRoadStop(), CmdRemoveRoadStop(), and IsRoadStopTile().

static bool IsRoadStopTile ( TileIndex  t)
inlinestatic

Is tile t a road stop station?

Parameters
tTile 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 CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::FollowTileExit(), GetAnyRoadBits(), GetRoadStopDir(), IsDriveThroughStopTile(), and IsStandardRoadStopTile().

static bool IsStandardRoadStopTile ( TileIndex  t)
inlinestatic
static bool IsTruckStop ( TileIndex  t)
inlinestatic

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 181 of file station_map.h.

References GetStationType().

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

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

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 623 of file station_map.h.

References MakeStation().

Referenced by CmdBuildAirport().

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

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 634 of file station_map.h.

References GetTileOwner(), and MakeStation().

Referenced by CmdBuildBuoy().

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

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 650 of file station_map.h.

References DiagDirToAxis(), GFX_DOCK_BASE_WATER_PART, MakeStation(), and TileOffsByDiagDir().

Referenced by CmdBuildDock().

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

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
rtthe roadtypes on this tile
athe direction of the roadstop

Definition at line 607 of file station_map.h.

References GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET, MakeStation(), ROADSTOP_BUS, ROADTYPE_ROAD, ROADTYPE_TRAM, SetRoadOwner(), and SetRoadTypes().

Referenced by CmdBuildRoadStop().

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

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 662 of file station_map.h.

References MakeStation(), and OWNER_NONE.

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

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 556 of file station_map.h.

References MakeStation(), SetRailStationReservation(), and SetRailType().

Referenced by CmdBuildRailStation().

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

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 572 of file station_map.h.

References MakeStation(), SetRailStationReservation(), and SetRailType().

Referenced by CmdBuildRailWaypoint(), and MoveWaypointsToBaseStations().

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

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
rtthe roadtypes on this tile
dthe direction of the roadstop

Definition at line 588 of file station_map.h.

References MakeStation(), ROADSTOP_BUS, ROADTYPE_ROAD, ROADTYPE_TRAM, SetRoadOwner(), and SetRoadTypes().

Referenced by CmdBuildRoadStop().

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

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

static void SetCustomStationSpecIndex ( TileIndex  t,
byte  specindex 
)
inlinestatic

Set the custom station spec for this tile.

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

Definition at line 482 of file station_map.h.

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

Referenced by CmdBuildRailStation(), CmdBuildRailWaypoint(), and MoveWaypointsToBaseStations().

static void SetRailStationReservation ( TileIndex  t,
bool  b 
)
inlinestatic
static void SetStationGfx ( TileIndex  t,
StationGfx  gfx 
)
inlinestatic

Set the station graphics of this tile.

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

Definition at line 81 of file station_map.h.

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

Referenced by AfterLoadGame(), and CmdBuildRailStation().

static void SetStationTileRandomBits ( TileIndex  t,
byte  random_bits 
)
inlinestatic

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 506 of file station_map.h.

References _m, IsTileType(), MP_STATION, and SB().

Referenced by CmdBuildAirport(), CmdBuildRailStation(), and TriggerStationRandomisation().