OpenTTD Source  20240915-master-g3784a3d3d6
road_map.h File Reference
#include "track_func.h"
#include "depot_type.h"
#include "rail_type.h"
#include "road_func.h"
#include "tile_map.h"
#include "road_type.h"

Go to the source code of this file.

Macros

#define IsOnDesert   IsOnSnow
 Check if a road tile has snow/desert.
 
#define ToggleDesert   ToggleSnow
 Toggle the snow/desert state of a road tile.
 

Enumerations

enum  RoadTileType { ROAD_TILE_NORMAL, ROAD_TILE_CROSSING, ROAD_TILE_DEPOT }
 The different types of road tiles. More...
 
enum  Roadside : uint8_t {
  ROADSIDE_BARREN = 0, ROADSIDE_GRASS = 1, ROADSIDE_PAVED = 2, ROADSIDE_STREET_LIGHTS = 3,
  ROADSIDE_TREES = 5, ROADSIDE_GRASS_ROAD_WORKS = 6, ROADSIDE_PAVED_ROAD_WORKS = 7
}
 The possible road side decorations. More...
 

Functions

bool MayHaveRoad (Tile t)
 Test whether a tile can have road/tram types. More...
 
static debug_inline RoadTileType GetRoadTileType (Tile t)
 Get the type of the road tile. More...
 
static debug_inline bool IsNormalRoad (Tile t)
 Return whether a tile is a normal road. More...
 
static debug_inline bool IsNormalRoadTile (Tile t)
 Return whether a tile is a normal road tile. More...
 
bool IsLevelCrossing (Tile t)
 Return whether a tile is a level crossing. More...
 
bool IsLevelCrossingTile (Tile t)
 Return whether a tile is a level crossing tile. More...
 
static debug_inline bool IsRoadDepot (Tile t)
 Return whether a tile is a road depot. More...
 
static debug_inline bool IsRoadDepotTile (Tile t)
 Return whether a tile is a road depot tile. More...
 
RoadBits GetRoadBits (Tile t, RoadTramType rtt)
 Get the present road bits for a specific road type. More...
 
RoadBits GetAllRoadBits (Tile tile)
 Get all set RoadBits on the given tile. More...
 
void SetRoadBits (Tile t, RoadBits r, RoadTramType rtt)
 Set the present road bits for a specific road type. More...
 
RoadType GetRoadTypeRoad (Tile t)
 
RoadType GetRoadTypeTram (Tile t)
 
RoadType GetRoadType (Tile t, RoadTramType rtt)
 
RoadTypes GetPresentRoadTypes (Tile t)
 Get the present road types of a tile. More...
 
bool HasRoadTypeRoad (Tile t)
 
bool HasRoadTypeTram (Tile t)
 
bool HasTileRoadType (Tile t, RoadTramType rtt)
 Check if a tile has a road or a tram road type. More...
 
bool HasTileAnyRoadType (Tile t, RoadTypes rts)
 Check if a tile has one of the specified road types. More...
 
Owner GetRoadOwner (Tile t, RoadTramType rtt)
 Get the owner of a specific road type. More...
 
void SetRoadOwner (Tile t, RoadTramType rtt, Owner o)
 Set the owner of a specific road type. More...
 
bool IsRoadOwner (Tile t, RoadTramType rtt, Owner o)
 Check if a specific road type is owned by an owner. More...
 
bool HasTownOwnedRoad (Tile t)
 Checks if given tile has town owned road. More...
 
bool IsValidDisallowedRoadDirections (DisallowedRoadDirections drt)
 Checks if a DisallowedRoadDirections is valid. More...
 
DisallowedRoadDirections GetDisallowedRoadDirections (Tile t)
 Gets the disallowed directions. More...
 
void SetDisallowedRoadDirections (Tile t, DisallowedRoadDirections drd)
 Sets the disallowed directions. More...
 
Axis GetCrossingRoadAxis (Tile t)
 Get the road axis of a level crossing. More...
 
Axis GetCrossingRailAxis (Tile t)
 Get the rail axis of a level crossing. More...
 
RoadBits GetCrossingRoadBits (Tile tile)
 Get the road bits of a level crossing. More...
 
Track GetCrossingRailTrack (Tile tile)
 Get the rail track of a level crossing. More...
 
TrackBits GetCrossingRailBits (Tile tile)
 Get the rail track bits of a level crossing. More...
 
bool HasCrossingReservation (Tile t)
 Get the reservation state of the rail crossing. More...
 
void SetCrossingReservation (Tile t, bool b)
 Set the reservation state of the rail crossing. More...
 
TrackBits GetCrossingReservationTrackBits (Tile t)
 Get the reserved track bits for a rail crossing. More...
 
bool IsCrossingBarred (Tile t)
 Check if the level crossing is barred. More...
 
void SetCrossingBarred (Tile t, bool barred)
 Set the bar state of a level crossing. More...
 
void UnbarCrossing (Tile t)
 Unbar a level crossing. More...
 
void BarCrossing (Tile t)
 Bar a level crossing. More...
 
bool IsOnSnow (Tile t)
 Check if a road tile has snow/desert. More...
 
void ToggleSnow (Tile t)
 Toggle the snow/desert state of a road tile. More...
 
Roadside GetRoadside (Tile tile)
 Get the decorations of a road. More...
 
void SetRoadside (Tile tile, Roadside s)
 Set the decorations of a road. More...
 
bool HasRoadWorks (Tile t)
 Check if a tile has road works. More...
 
bool IncreaseRoadWorksCounter (Tile t)
 Increase the progress counter of road works. More...
 
void StartRoadWorks (Tile t)
 Start road works on a tile. More...
 
void TerminateRoadWorks (Tile t)
 Terminate road works on a tile. More...
 
DiagDirection GetRoadDepotDirection (Tile t)
 Get the direction of the exit of a road depot. More...
 
RoadBits GetAnyRoadBits (Tile tile, RoadTramType rtt, bool straight_tunnel_bridge_entrance=false)
 Returns the RoadBits on an arbitrary tile Special behaviour: More...
 
void SetRoadTypeRoad (Tile t, RoadType rt)
 Set the road road type of a tile. More...
 
void SetRoadTypeTram (Tile t, RoadType rt)
 Set the tram road type of a tile. More...
 
void SetRoadType (Tile t, RoadTramType rtt, RoadType rt)
 Set the road type of a tile. More...
 
void SetRoadTypes (Tile t, RoadType road_rt, RoadType tram_rt)
 Set the present road types of a tile. More...
 
void MakeRoadNormal (Tile t, RoadBits bits, RoadType road_rt, RoadType tram_rt, TownID town, Owner road, Owner tram)
 Make a normal road tile. More...
 
void MakeRoadCrossing (Tile t, Owner road, Owner tram, Owner rail, Axis roaddir, RailType rat, RoadType road_rt, RoadType tram_rt, uint town)
 Make a level crossing. More...
 
void SetRoadDepotExitDirection (Tile tile, DiagDirection dir)
 Sets the exit direction of a road depot. More...
 
void MakeRoadDepot (Tile tile, Owner owner, DepotID depot_id, DiagDirection dir, RoadType rt)
 Make a road depot. More...
 

Detailed Description

Map accessors for roads.

Definition in file road_map.h.

Enumeration Type Documentation

◆ Roadside

enum Roadside : uint8_t

The possible road side decorations.

Enumerator
ROADSIDE_BARREN 

Road on barren land.

ROADSIDE_GRASS 

Road on grass.

ROADSIDE_PAVED 

Road with paved sidewalks.

ROADSIDE_STREET_LIGHTS 

Road with street lights on paved sidewalks.

ROADSIDE_TREES 

Road with trees on paved sidewalks.

ROADSIDE_GRASS_ROAD_WORKS 

Road on grass with road works.

ROADSIDE_PAVED_ROAD_WORKS 

Road with sidewalks and road works.

Definition at line 477 of file road_map.h.

◆ RoadTileType

The different types of road tiles.

Enumerator
ROAD_TILE_NORMAL 

Normal road.

ROAD_TILE_CROSSING 

Level crossing.

ROAD_TILE_DEPOT 

Depot (one entrance)

Definition at line 22 of file road_map.h.

Function Documentation

◆ BarCrossing()

void BarCrossing ( Tile  t)
inline

Bar a level crossing.

Parameters
tThe tile to change.

Definition at line 447 of file road_map.h.

References SetCrossingBarred().

◆ GetAllRoadBits()

RoadBits GetAllRoadBits ( Tile  tile)
inline

Get all set RoadBits on the given tile.

Parameters
tileThe tile from which we want to get the RoadBits
Returns
all set RoadBits of the tile

Definition at line 141 of file road_map.h.

References GetRoadBits().

Referenced by GetAxisForNewRoadWaypoint().

◆ GetAnyRoadBits()

RoadBits GetAnyRoadBits ( Tile  tile,
RoadTramType  rtt,
bool  straight_tunnel_bridge_entrance 
)

Returns the RoadBits on an arbitrary tile Special behaviour:

  • road depots: entrance is treated as road piece
  • road tunnels: entrance is treated as road piece
  • bridge ramps: start of the ramp is treated as road piece
  • bridge middle parts: bridge itself is ignored

If straight_tunnel_bridge_entrance is set a ROAD_X or ROAD_Y for bridge ramps and tunnel entrances is returned depending on the orientation of the tunnel or bridge.

Parameters
tilethe tile to get the road bits for
rtthe road type to get the road bits form
straight_tunnel_bridge_entrancewhether to return straight road bits for tunnels/bridges.
Returns
the road bits of the given tile

Definition at line 33 of file road_map.cpp.

References AxisToRoadBits(), DIAGDIR_NE, DiagDirToAxis(), DiagDirToRoadBits(), GetCrossingRoadBits(), GetRoadBits(), GetRoadDepotDirection(), GetRoadStopDir(), GetRoadTileType(), GetTileType(), GetTunnelBridgeDirection(), GetTunnelBridgeTransportType(), HasTileRoadType(), IsAnyRoadStopTile(), IsDriveThroughStopTile(), MayHaveRoad(), MP_ROAD, MP_STATION, MP_TUNNELBRIDGE, ReverseDiagDir(), ROAD_NONE, ROAD_TILE_CROSSING, ROAD_TILE_DEPOT, ROAD_TILE_NORMAL, ROAD_X, ROAD_Y, and TRANSPORT_ROAD.

Referenced by CleanUpRoadBits(), and GetTownRoadBits().

◆ GetCrossingRailAxis()

Axis GetCrossingRailAxis ( Tile  t)
inline

Get the rail axis of a level crossing.

Parameters
tThe tile to query.
Precondition
IsLevelCrossing(t)
Returns
The axis of the rail.

Definition at line 337 of file road_map.h.

References GetCrossingRoadAxis(), IsLevelCrossing(), and OtherAxis().

Referenced by DrawTile_Road(), GetCrossingRailBits(), GetCrossingRailTrack(), and TrainApproachingCrossing().

◆ GetCrossingRailBits()

TrackBits GetCrossingRailBits ( Tile  tile)
inline

Get the rail track bits of a level crossing.

Parameters
tileThe tile to query.
Returns
The rail track bits.

Definition at line 368 of file road_map.h.

References AxisToTrackBits(), and GetCrossingRailAxis().

Referenced by GetCrossingReservationTrackBits(), and GetRailTrackBitsUniversal().

◆ GetCrossingRailTrack()

Track GetCrossingRailTrack ( Tile  tile)
inline

Get the rail track of a level crossing.

Parameters
tileThe tile to query.
Returns
The rail track.

Definition at line 358 of file road_map.h.

References AxisToTrack(), and GetCrossingRailAxis().

Referenced by CmdConvertRail().

◆ GetCrossingReservationTrackBits()

TrackBits GetCrossingReservationTrackBits ( Tile  t)
inline

Get the reserved track bits for a rail crossing.

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

Definition at line 405 of file road_map.h.

References GetCrossingRailBits(), HasCrossingReservation(), and TRACK_BIT_NONE.

Referenced by GetReservedTrackbits().

◆ GetCrossingRoadAxis()

Axis GetCrossingRoadAxis ( Tile  t)
inline

Get the road axis of a level crossing.

Parameters
tThe tile to query.
Precondition
IsLevelCrossing(t)
Returns
The axis of the road.

Definition at line 325 of file road_map.h.

References GB(), IsLevelCrossing(), and Tile::m5().

Referenced by GetCrossingRailAxis(), GetCrossingRoadBits(), MarkDirtyAdjacentLevelCrossingTiles(), TrainApproachingCrossingTile(), UpdateAdjacentLevelCrossingTilesOnLevelCrossingRemoval(), and UpdateLevelCrossing().

◆ GetCrossingRoadBits()

RoadBits GetCrossingRoadBits ( Tile  tile)
inline

Get the road bits of a level crossing.

Parameters
tileThe tile to query.
Returns
The present road bits.

Definition at line 348 of file road_map.h.

References AXIS_X, GetCrossingRoadAxis(), ROAD_X, and ROAD_Y.

Referenced by GetAnyRoadBits().

◆ GetDisallowedRoadDirections()

DisallowedRoadDirections GetDisallowedRoadDirections ( Tile  t)
inline

Gets the disallowed directions.

Parameters
tthe tile to get the directions from
Returns
the disallowed directions

Definition at line 301 of file road_map.h.

References GB(), IsNormalRoad(), and Tile::m5().

Referenced by GrowTownWithBridge().

◆ GetPresentRoadTypes()

RoadTypes GetPresentRoadTypes ( Tile  t)
inline

Get the present road types of a tile.

Parameters
tThe tile to query.
Returns
Present road types.

Definition at line 185 of file road_map.h.

Referenced by HasTileAnyRoadType().

◆ GetRoadBits()

RoadBits GetRoadBits ( Tile  t,
RoadTramType  rtt 
)
inline

Get the present road bits for a specific road type.

Parameters
tThe tile to query.
rtRoad type.
Precondition
IsNormalRoad(t)
Returns
The present road bits for the road type.

Definition at line 128 of file road_map.h.

References IsNormalRoad().

Referenced by ConnectRoadToStructure(), DrawRoadBits(), DrawRoadCatenary(), GetAllRoadBits(), GetAnyRoadBits(), and CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::GetSingleTramBit().

◆ GetRoadDepotDirection()

◆ GetRoadOwner()

Owner GetRoadOwner ( Tile  t,
RoadTramType  rtt 
)
inline

Get the owner of a specific road type.

Parameters
tThe tile to query.
rttRoadTramType.
Returns
Owner of the given road type.

Definition at line 234 of file road_map.h.

References MayHaveRoad().

Referenced by FixOwnerOfRailTrack(), and IsRoadOwner().

◆ GetRoadside()

Roadside GetRoadside ( Tile  tile)
inline

Get the decorations of a road.

Parameters
tileThe tile to query.
Returns
The road decoration of the tile.

Definition at line 493 of file road_map.h.

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

Referenced by HasRoadWorks(), StartRoadWorks(), and TerminateRoadWorks().

◆ GetRoadTileType()

static debug_inline RoadTileType GetRoadTileType ( Tile  t)
static

Get the type of the road tile.

Parameters
tTile to query.
Precondition
IsTileType(t, MP_ROAD)
Returns
The road tile type.

Definition at line 52 of file road_map.h.

Referenced by DrawTile_Road(), GetAnyRoadBits(), and IsLevelCrossing().

◆ HasCrossingReservation()

bool HasCrossingReservation ( Tile  t)
inline

Get the reservation state of the rail crossing.

Parameters
tthe crossing tile
Returns
reservation state
Precondition
IsLevelCrossingTile(t)

Definition at line 380 of file road_map.h.

References HasBit(), IsLevelCrossingTile(), and Tile::m5().

Referenced by CheckLevelCrossing(), GetCrossingReservationTrackBits(), and TryReserveRailTrack().

◆ HasRoadWorks()

bool HasRoadWorks ( Tile  t)
inline

Check if a tile has road works.

Parameters
tThe tile to check.
Returns
True if the tile has road works in progress.

Definition at line 513 of file road_map.h.

References GetRoadside(), and ROADSIDE_GRASS_ROAD_WORKS.

Referenced by StartRoadWorks(), and TerminateRoadWorks().

◆ HasTileAnyRoadType()

bool HasTileAnyRoadType ( Tile  t,
RoadTypes  rts 
)
inline

Check if a tile has one of the specified road types.

Parameters
tThe tile to check.
rtsAllowed road types.
Returns
True if the tile has one of the specified road types.

Definition at line 222 of file road_map.h.

References GetPresentRoadTypes(), and MayHaveRoad().

Referenced by CheckRoadBlockedForOvertaking(), CmdBuildRoadVehicle(), RoadStop::GetNextRoadStop(), and GetVehicleCannotUseStationReason().

◆ HasTileRoadType()

bool HasTileRoadType ( Tile  t,
RoadTramType  rtt 
)
inline

Check if a tile has a road or a tram road type.

Parameters
tThe tile to check.
tramTrue to check tram, false to check road.
Returns
True if the tile has the specified road type.

Definition at line 211 of file road_map.h.

Referenced by GetAnyRoadBits(), HasTownOwnedRoad(), and IsRoadOwner().

◆ HasTownOwnedRoad()

bool HasTownOwnedRoad ( Tile  t)
inline

Checks if given tile has town owned road.

Parameters
ttile to check
Precondition
IsTileType(t, MP_ROAD)
Returns
true iff tile has road and the road is owned by a town

Definition at line 280 of file road_map.h.

References HasTileRoadType().

Referenced by ClosestTownFromTile(), UpdateNearestTownForRoadTiles(), and Town::~Town().

◆ IncreaseRoadWorksCounter()

bool IncreaseRoadWorksCounter ( Tile  t)
inline

Increase the progress counter of road works.

Parameters
tThe tile to modify.
Returns
True if the road works are in the last stage.

Definition at line 523 of file road_map.h.

References AB(), GB(), and Tile::m7().

◆ IsCrossingBarred()

bool IsCrossingBarred ( Tile  t)
inline

Check if the level crossing is barred.

Parameters
tThe tile to query.
Precondition
IsLevelCrossing(t)
Returns
True if the level crossing is barred.

Definition at line 416 of file road_map.h.

References HasBit(), IsLevelCrossing(), and Tile::m5().

Referenced by MaybeBarCrossingWithSound(), UpdateAdjacentLevelCrossingTilesOnLevelCrossingRemoval(), and UpdateLevelCrossingTile().

◆ IsLevelCrossing()

bool IsLevelCrossing ( Tile  t)
inline

◆ IsLevelCrossingTile()

bool IsLevelCrossingTile ( Tile  t)
inline

◆ IsNormalRoad()

static debug_inline bool IsNormalRoad ( Tile  t)
static

Return whether a tile is a normal road.

Parameters
tTile to query.
Precondition
IsTileType(t, MP_ROAD)
Returns
True if normal road.

Definition at line 64 of file road_map.h.

Referenced by DrawRoadCatenary(), GetDisallowedRoadDirections(), GetRoadBits(), SetDisallowedRoadDirections(), and SetRoadBits().

◆ IsNormalRoadTile()

static debug_inline bool IsNormalRoadTile ( Tile  t)
static

Return whether a tile is a normal road tile.

Parameters
tTile to query.
Returns
True if normal road tile.

Definition at line 74 of file road_map.h.

Referenced by CleanUpRoadBits(), ConnectRoadToStructure(), GetAxisForNewRoadWaypoint(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::GetSingleTramBit(), and GrowTownWithBridge().

◆ IsOnSnow()

bool IsOnSnow ( Tile  t)
inline

Check if a road tile has snow/desert.

Parameters
tThe tile to query.
Returns
True if the tile has snow/desert.

Definition at line 459 of file road_map.h.

References HasBit(), and Tile::m7().

◆ IsRoadDepot()

static debug_inline bool IsRoadDepot ( Tile  t)
static

Return whether a tile is a road depot.

Parameters
tTile to query.
Precondition
IsTileType(t, MP_ROAD)
Returns
True if road depot.

Definition at line 106 of file road_map.h.

Referenced by CanRoadContinueIntoNextTile(), ClosestTownFromTile(), GetRoadDepotDirection(), GetTownIndex(), SetTownIndex(), and UpdateNearestTownForRoadTiles().

◆ IsRoadDepotTile()

static debug_inline bool IsRoadDepotTile ( Tile  t)
static

Return whether a tile is a road depot tile.

Parameters
tTile to query.
Returns
True if road depot tile.

Definition at line 116 of file road_map.h.

Referenced by GetDepotIndex(), GetTownRoadBits(), IsDepotTile(), CYapfCostRoadT< Types >::PfCalcCost(), CYapfDestinationAnyDepotRoadT< Types >::PfDetectDestination(), and SetRoadDepotExitDirection().

◆ IsRoadOwner()

bool IsRoadOwner ( Tile  t,
RoadTramType  rtt,
Owner  o 
)
inline

Check if a specific road type is owned by an owner.

Parameters
tThe tile to query.
tramTrue to check tram, false to check road.
oOwner to compare with.
Precondition
HasTileRoadType(t, rt)
Returns
True if the road type is owned by the given owner.

Definition at line 268 of file road_map.h.

References GetRoadOwner(), and HasTileRoadType().

◆ IsValidDisallowedRoadDirections()

bool IsValidDisallowedRoadDirections ( DisallowedRoadDirections  drt)
inline

Checks if a DisallowedRoadDirections is valid.

Parameters
wcThe value to check
Returns
true if the given value is a valid DisallowedRoadDirections.

Definition at line 291 of file road_map.h.

References DRD_END.

Referenced by CmdBuildLongRoad().

◆ MakeRoadCrossing()

void MakeRoadCrossing ( Tile  t,
Owner  road,
Owner  tram,
Owner  rail,
Axis  roaddir,
RailType  rat,
RoadType  road_rt,
RoadType  tram_rt,
uint  town 
)
inline

Make a level crossing.

Parameters
tTile to make a level crossing.
roadNew owner of road.
tramNew owner of tram tracks.
railNew owner of the rail track.
roaddirAxis of the road.
ratNew rail type.
road_rtThe road roadtype to set for the tile.
tram_rtThe tram roadtype to set for the tile.
townTown ID if the road is a town-owned road.

Definition at line 660 of file road_map.h.

References INVALID_ROADTYPE, Tile::m2(), Tile::m3(), Tile::m4(), Tile::m5(), Tile::m6(), Tile::m7(), Tile::m8(), MP_ROAD, ROAD_TILE_CROSSING, SB(), SetRoadOwner(), SetRoadTypes(), SetTileOwner(), and SetTileType().

◆ MakeRoadDepot()

void MakeRoadDepot ( Tile  tile,
Owner  owner,
DepotID  depot_id,
DiagDirection  dir,
RoadType  rt 
)
inline

Make a road depot.

Parameters
tileTile to make a depot on.
ownerNew owner of the depot.
depot_idNew depot ID.
dirDirection of the depot exit.
rtRoad type of the depot.

Definition at line 694 of file road_map.h.

References INVALID_ROADTYPE, Tile::m2(), Tile::m3(), Tile::m4(), Tile::m5(), Tile::m6(), Tile::m7(), Tile::m8(), MP_ROAD, Window::owner, ROAD_TILE_DEPOT, SB(), SetRoadType(), SetTileOwner(), and SetTileType().

◆ MakeRoadNormal()

void MakeRoadNormal ( Tile  t,
RoadBits  bits,
RoadType  road_rt,
RoadType  tram_rt,
TownID  town,
Owner  road,
Owner  tram 
)
inline

Make a normal road tile.

Parameters
tTile to make a normal road.
bitsRoad bits to set for all present road types.
road_rtThe road roadtype to set for the tile.
tram_rtThe tram roadtype to set for the tile.
townTown ID if the road is a town-owned road.
roadNew owner of road.
tramNew owner of tram tracks.

Definition at line 635 of file road_map.h.

References INVALID_ROADTYPE, Tile::m2(), Tile::m3(), Tile::m5(), Tile::m6(), Tile::m7(), MP_ROAD, ROAD_TILE_NORMAL, SB(), SetRoadOwner(), SetRoadTypes(), SetTileOwner(), and SetTileType().

◆ MayHaveRoad()

bool MayHaveRoad ( Tile  t)
inline

Test whether a tile can have road/tram types.

Parameters
tTile to query.
Returns
true if tile can be queried about road/tram types.

Definition at line 33 of file road_map.h.

References GetTileType(), MP_ROAD, MP_STATION, and MP_TUNNELBRIDGE.

Referenced by CanConnectToRoad(), DrawRoadTypeCatenary(), GetAnyRoadBits(), GetRoadOwner(), HasTileAnyRoadType(), RemoveRoad(), SetRoadTypeRoad(), and SetRoadTypeTram().

◆ SetCrossingBarred()

void SetCrossingBarred ( Tile  t,
bool  barred 
)
inline

Set the bar state of a level crossing.

Parameters
tThe tile to modify.
barredTrue if the crossing should be barred, false otherwise.
Precondition
IsLevelCrossing(t)

Definition at line 428 of file road_map.h.

References AssignBit(), IsLevelCrossing(), and Tile::m5().

Referenced by BarCrossing(), UnbarCrossing(), and UpdateAdjacentLevelCrossingTilesOnLevelCrossingRemoval().

◆ SetCrossingReservation()

void SetCrossingReservation ( Tile  t,
bool  b 
)
inline

Set the reservation state of the rail crossing.

Note
Works for both waypoints and rail depots
Parameters
tthe crossing tile
bthe reservation state
Precondition
IsLevelCrossingTile(t)

Definition at line 393 of file road_map.h.

References AssignBit(), IsLevelCrossingTile(), and Tile::m5().

Referenced by MaybeBarCrossingWithSound(), TryReserveRailTrack(), and UnreserveRailTrack().

◆ SetDisallowedRoadDirections()

void SetDisallowedRoadDirections ( Tile  t,
DisallowedRoadDirections  drd 
)
inline

Sets the disallowed directions.

Parameters
tthe tile to set the directions for
drdthe disallowed directions

Definition at line 312 of file road_map.h.

References DRD_END, IsNormalRoad(), Tile::m5(), and SB().

◆ SetRoadBits()

void SetRoadBits ( Tile  t,
RoadBits  r,
RoadTramType  rtt 
)
inline

Set the present road bits for a specific road type.

Parameters
tThe tile to change.
rThe new road bits.
rtRoad type.
Precondition
IsNormalRoad(t)

Definition at line 153 of file road_map.h.

References IsNormalRoad().

◆ SetRoadDepotExitDirection()

void SetRoadDepotExitDirection ( Tile  tile,
DiagDirection  dir 
)
inline

Sets the exit direction of a road depot.

Parameters
tileTile of the depot.
dirDirection of the depot exit.

Definition at line 680 of file road_map.h.

References IsRoadDepotTile(), Tile::m5(), and SB().

◆ SetRoadOwner()

void SetRoadOwner ( Tile  t,
RoadTramType  rtt,
Owner  o 
)
inline

Set the owner of a specific road type.

Parameters
tThe tile to change.
rttRoadTramType.
oNew owner of the given road type.

Definition at line 251 of file road_map.h.

Referenced by ConvertRoadTypeOwner(), MakeDriveThroughRoadStop(), MakeRoadBridgeRamp(), MakeRoadCrossing(), MakeRoadNormal(), and MakeRoadTunnel().

◆ SetRoadside()

void SetRoadside ( Tile  tile,
Roadside  s 
)
inline

Set the decorations of a road.

Parameters
tileThe tile to change.
sThe new road decoration of the tile.

Definition at line 503 of file road_map.h.

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

Referenced by StartRoadWorks(), and TerminateRoadWorks().

◆ SetRoadType()

void SetRoadType ( Tile  t,
RoadTramType  rtt,
RoadType  rt 
)
inline

Set the road type of a tile.

Parameters
tThe tile to change.
rttSet road or tram type.
rtThe road type to set.

Definition at line 604 of file road_map.h.

Referenced by MakeRoadDepot().

◆ SetRoadTypeRoad()

void SetRoadTypeRoad ( Tile  t,
RoadType  rt 
)
inline

Set the road road type of a tile.

Parameters
tThe tile to change.
rtThe road type to set.

Definition at line 579 of file road_map.h.

References INVALID_ROADTYPE, and MayHaveRoad().

Referenced by SetRoadTypes().

◆ SetRoadTypes()

void SetRoadTypes ( Tile  t,
RoadType  road_rt,
RoadType  tram_rt 
)
inline

Set the present road types of a tile.

Parameters
tThe tile to change.
road_rtThe road roadtype to set for the tile.
tram_rtThe tram roadtype to set for the tile.

Definition at line 619 of file road_map.h.

References SetRoadTypeRoad(), and SetRoadTypeTram().

Referenced by MakeDriveThroughRoadStop(), MakeRailTunnel(), MakeRoadCrossing(), and MakeRoadNormal().

◆ SetRoadTypeTram()

void SetRoadTypeTram ( Tile  t,
RoadType  rt 
)
inline

Set the tram road type of a tile.

Parameters
tThe tile to change.
rtThe road type to set.

Definition at line 591 of file road_map.h.

References INVALID_ROADTYPE, and MayHaveRoad().

Referenced by SetRoadTypes().

◆ StartRoadWorks()

void StartRoadWorks ( Tile  t)
inline

Start road works on a tile.

Parameters
tThe tile to start the work on.
Precondition
!HasRoadWorks(t)

Definition at line 535 of file road_map.h.

References GetRoadside(), HasRoadWorks(), ROADSIDE_BARREN, ROADSIDE_GRASS, ROADSIDE_GRASS_ROAD_WORKS, ROADSIDE_PAVED_ROAD_WORKS, and SetRoadside().

◆ TerminateRoadWorks()

void TerminateRoadWorks ( Tile  t)
inline

Terminate road works on a tile.

Parameters
tTile to stop the road works on.
Precondition
HasRoadWorks(t)

Definition at line 551 of file road_map.h.

References GetRoadside(), HasRoadWorks(), Tile::m7(), ROADSIDE_GRASS, ROADSIDE_GRASS_ROAD_WORKS, SB(), and SetRoadside().

◆ ToggleSnow()

void ToggleSnow ( Tile  t)
inline

Toggle the snow/desert state of a road tile.

Parameters
tThe tile to change.

Definition at line 470 of file road_map.h.

References Tile::m7(), and ToggleBit().

◆ UnbarCrossing()

void UnbarCrossing ( Tile  t)
inline

Unbar a level crossing.

Parameters
tThe tile to change.

Definition at line 438 of file road_map.h.

References SetCrossingBarred().