OpenTTD: src/road_map.h File Reference

OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

Data Structures | Macros | Enumerations | Functions
road_map.h File Reference

Map accessors for roads. More...

`#include "track_func.h"`
`#include "depot_type.h"`
`#include "rail_type.h"`
`#include "road_func.h"`
`#include "tile_map.h"`

Go to the source code of this file.

## Data Structures
struct | EnumPropsT< DisallowedRoadDirections >
| Helper information for extract tool. More...

## 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 | DisallowedRoadDirections { DRD_NONE, DRD_SOUTHBOUND, DRD_NORTHBOUND, DRD_BOTH, DRD_END }
| Which directions are disallowed ? More...
enum | Roadside { 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
static RoadTileType | GetRoadTileType (TileIndex t)
| Get the type of the road tile.
static bool | IsNormalRoad (TileIndex t)
| Return whether a tile is a normal road.
static bool | IsNormalRoadTile (TileIndex t)
| Return whether a tile is a normal road tile.
static bool | IsLevelCrossing (TileIndex t)
| Return whether a tile is a level crossing.
static bool | IsLevelCrossingTile (TileIndex t)
| Return whether a tile is a level crossing tile.
static bool | IsRoadDepot (TileIndex t)
| Return whether a tile is a road depot.
static bool | IsRoadDepotTile (TileIndex t)
| Return whether a tile is a road depot tile.
static RoadBits | GetRoadBits (TileIndex t, RoadType rt)
| Get the present road bits for a specific road type.
static RoadBits | GetOtherRoadBits (TileIndex t, RoadType rt)
| Get all RoadBits set on a tile except from the given RoadType.
static RoadBits | GetAllRoadBits (TileIndex tile)
| Get all set RoadBits on the given tile.
static void | SetRoadBits (TileIndex t, RoadBits r, RoadType rt)
| Set the present road bits for a specific road type.
static RoadTypes | GetRoadTypes (TileIndex t)
| Get the present road types of a tile.
static void | SetRoadTypes (TileIndex t, RoadTypes rt)
| Set the present road types of a tile.
static bool | HasTileRoadType (TileIndex t, RoadType rt)
| Check if a tile has a specific road type.
static Owner | GetRoadOwner (TileIndex t, RoadType rt)
| Get the owner of a specific road type.
static void | SetRoadOwner (TileIndex t, RoadType rt, Owner o)
| Set the owner of a specific road type.
static bool | IsRoadOwner (TileIndex t, RoadType rt, Owner o)
| Check if a specific road type is owned by an owner.
static bool | HasTownOwnedRoad (TileIndex t)
| Checks if given tile has town owned road.
static DisallowedRoadDirections | GetDisallowedRoadDirections (TileIndex t)
| Gets the disallowed directions.
static void | SetDisallowedRoadDirections (TileIndex t, DisallowedRoadDirections drd)
| Sets the disallowed directions.
static Axis | GetCrossingRoadAxis (TileIndex t)
| Get the road axis of a level crossing.
static Axis | GetCrossingRailAxis (TileIndex t)
| Get the rail axis of a level crossing.
static RoadBits | GetCrossingRoadBits (TileIndex tile)
| Get the road bits of a level crossing.
static Track | GetCrossingRailTrack (TileIndex tile)
| Get the rail track of a level crossing.
static TrackBits | GetCrossingRailBits (TileIndex tile)
| Get the rail track bits of a level crossing.
static bool | HasCrossingReservation (TileIndex t)
| Get the reservation state of the rail crossing.
static void | SetCrossingReservation (TileIndex t, bool b)
| Set the reservation state of the rail crossing.
static TrackBits | GetCrossingReservationTrackBits (TileIndex t)
| Get the reserved track bits for a rail crossing.
static bool | IsCrossingBarred (TileIndex t)
| Check if the level crossing is barred.
static void | SetCrossingBarred (TileIndex t, bool barred)
| Set the bar state of a level crossing.
static void | UnbarCrossing (TileIndex t)
| Unbar a level crossing.
static void | BarCrossing (TileIndex t)
| Bar a level crossing.
static bool | IsOnSnow (TileIndex t)
| Check if a road tile has snow/desert.
static void | ToggleSnow (TileIndex t)
| Toggle the snow/desert state of a road tile.
static Roadside | GetRoadside (TileIndex tile)
| Get the decorations of a road.
static void | SetRoadside (TileIndex tile, Roadside s)
| Set the decorations of a road.
static bool | HasRoadWorks (TileIndex t)
| Check if a tile has road works.
static bool | IncreaseRoadWorksCounter (TileIndex t)
| Increase the progress counter of road works.
static void | StartRoadWorks (TileIndex t)
| Start road works on a tile.
static void | TerminateRoadWorks (TileIndex t)
| Terminate road works on a tile.
static DiagDirection | GetRoadDepotDirection (TileIndex t)
| Get the direction of the exit of a road depot.
RoadBits | GetAnyRoadBits (TileIndex tile, RoadType rt, bool straight_tunnel_bridge_entrance=false)
| Returns the RoadBits on an arbitrary tile Special behaviour:
static void | MakeRoadNormal (TileIndex t, RoadBits bits, RoadTypes rot, TownID town, Owner road, Owner tram)
| Make a normal road tile.
static void | MakeRoadCrossing (TileIndex t, Owner road, Owner tram, Owner rail, Axis roaddir, RailType rat, RoadTypes rot, uint town)
| Make a level crossing.
static void | MakeRoadDepot (TileIndex t, Owner owner, DepotID did, DiagDirection dir, RoadType rt)
| Make a road depot.

## Detailed Description

Map accessors for roads.

Definition in file road_map.h.

## Macro Definition Documentation

#define IsOnDesert IsOnSnow

Check if a road tile has snow/desert.

Definition at line 423 of file road_map.h.

#define ToggleDesert ToggleSnow

Toggle the snow/desert state of a road tile.

Definition at line 435 of file road_map.h.

## Enumeration Type Documentation

enum DisallowedRoadDirections

Which directions are disallowed ?

Enumerator:

  DRD_NONE | None of the directions are disallowed.
  DRD_SOUTHBOUND | All southbound traffic is disallowed.
  DRD_NORTHBOUND | All northbound traffic is disallowed.
  DRD_BOTH | All directions are disallowed.
  DRD_END | Sentinel.

Definition at line 255 of file road_map.h.

enum Roadside

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 447 of file road_map.h.

enum 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 23 of file road_map.h.

## Function Documentation

static void BarCrossing | ( | TileIndex | t | ) |
| inlinestatic

Bar a level crossing.

Parameters

  t | The tile to change.

Definition at line 417 of file road_map.h.

References SetCrossingBarred().

Referenced by MaybeBarCrossingWithSound(), and TryReserveRailTrack().

static RoadBits GetAllRoadBits | ( | TileIndex | tile | ) |
| inlinestatic

Get all set RoadBits on the given tile.

Parameters

  tile | The tile from which we want to get the RoadBits

Returns
  all set RoadBits of the tile

Definition at line 139 of file road_map.h.

References GetRoadBits(), ROADTYPE_ROAD, and ROADTYPE_TRAM.

Referenced by CheckFlatLandRoadStop().

RoadBits GetAnyRoadBits | ( | TileIndex | tile,
|  | RoadType | rt,
|  | 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

  tile | the tile to get the road bits for
  rt | the road type to get the road bits form
  straight_tunnel_bridge_entrance | whether to return straight road bits for tunnels/bridges.

Returns
  the road bits of the given tile

Definition at line 35 of file road_map.cpp.

References AxisToRoadBits(), DIAGDIR_NE, DiagDirToAxis(), DiagDirToRoadBits(), GetCrossingRoadBits(), GetRoadBits(), GetRoadDepotDirection(), GetRoadStopDir(), GetRoadTileType(), GetTileType(), GetTunnelBridgeDirection(), GetTunnelBridgeTransportType(), HasTileRoadType(), IsDriveThroughStopTile(), IsRoadStopTile(), 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 CanConnectToRoad(), CanRemoveRoadWithStop(), CheckAllowRemoveRoad(), CleanUpRoadBits(), CmdBuildRoad(), GetTownRoadBits(), and RoadFindPathToDest().

static Axis GetCrossingRailAxis | ( | TileIndex | t | ) |
| inlinestatic

Get the rail axis of a level crossing.

Parameters

  t | The tile to query.

Precondition
  IsLevelCrossing(t)

Returns
  The axis of the rail.

Definition at line 307 of file road_map.h.

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

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

static TrackBits GetCrossingRailBits | ( | TileIndex | tile | ) |
| inlinestatic

Get the rail track bits of a level crossing.

Parameters

  tile | The tile to query.

Returns
  The rail track bits.

Definition at line 338 of file road_map.h.

References AxisToTrackBits(), and GetCrossingRailAxis().

Referenced by CmdBuildSingleRail(), CmdRemoveSingleRail(), GetCrossingReservationTrackBits(), GetRailTrackBitsUniversal(), and RemoveRoad().

static Track GetCrossingRailTrack | ( | TileIndex | tile | ) |
| inlinestatic

Get the rail track of a level crossing.

Parameters

  tile | The tile to query.

Returns
  The rail track.

Definition at line 328 of file road_map.h.

References AxisToTrack(), and GetCrossingRailAxis().

Referenced by CmdConvertRail(), and RemoveRoad().

static TrackBits GetCrossingReservationTrackBits | ( | TileIndex | t | ) |
| inlinestatic

Get the reserved track bits for a rail crossing.

Parameters

  t | the tile

Precondition
  IsLevelCrossingTile(t)

Returns
  reserved track bits

Definition at line 375 of file road_map.h.

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

Referenced by GetReservedTrackbits().

static Axis GetCrossingRoadAxis | ( | TileIndex | t | ) |
| inlinestatic

Get the road axis of a level crossing.

Parameters

  t | The tile to query.

Precondition
  IsLevelCrossing(t)

Returns
  The axis of the road.

Definition at line 295 of file road_map.h.

References _m, GB(), and IsLevelCrossing().

Referenced by CanEnterTileOwnerCheck(), DrawTile_Road(), ExploreSegment(), GetCrossingRailAxis(), GetCrossingRoadBits(), and TrainApproachingCrossingTile().

static RoadBits GetCrossingRoadBits | ( | TileIndex | tile | ) |
| inlinestatic

Get the road bits of a level crossing.

Parameters

  tile | The tile to query.

Returns
  The present road bits.

Definition at line 318 of file road_map.h.

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

Referenced by CmdBuildRoad(), CmdRemoveSingleRail(), DrawTile_Road(), FixOwnerOfRailTrack(), GetAnyRoadBits(), and RemoveRoad().

static DisallowedRoadDirections GetDisallowedRoadDirections | ( | TileIndex | t | ) |
| inlinestatic

Gets the disallowed directions.

Parameters

  t | the tile to get the directions from

Returns
  the disallowed directions

Definition at line 271 of file road_map.h.

References _m, GB(), and IsNormalRoad().

Referenced by CmdBuildRoad(), CmdBuildSingleRail(), CmdTurnRoadVeh(), and DrawRoadBits().

static RoadBits GetOtherRoadBits | ( | TileIndex | t,
|  | RoadType | rt
| ) |  |
| inlinestatic

Get all RoadBits set on a tile except from the given RoadType.

Parameters

  t | The tile from which we want to get the RoadBits
  rt | The RoadType which we exclude from the querry

Returns
  all set RoadBits of the tile which are not from the given RoadType

Definition at line 128 of file road_map.h.

References GetRoadBits(), ROADTYPE_ROAD, and ROADTYPE_TRAM.

Referenced by CmdBuildRoad(), and RemoveRoad().

static RoadBits GetRoadBits | ( | TileIndex | t,
|  | RoadType | rt
| ) |  |
| inlinestatic

Get the present road bits for a specific road type.

Parameters

  t | The tile to query.
  rt | Road type.

Precondition
  IsNormalRoad(t)

Returns
  The present road bits for the road type.

Definition at line 111 of file road_map.h.

References _m, GB(), IsNormalRoad(), ROADTYPE_ROAD, and ROADTYPE_TRAM.

Referenced by AfterLoadCompanyStats(), CheckFlatLandRoadStop(), CmdBuildRoad(), CmdBuildRoadStop(), CmdBuildSingleRail(), ConnectRoadToStructure(), DrawRoadBits(), GetAllRoadBits(), GetAnyRoadBits(), GetOtherRoadBits(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::GetSingleTramBit(), GetSingleTramBit(), and RemoveRoad().

static DiagDirection GetRoadDepotDirection | ( | TileIndex | t | ) |
| inlinestatic

Get the direction of the exit of a road depot.

Parameters

  t | The tile to query.

Returns
  Diagonal direction of the depot exit.

Definition at line 534 of file road_map.h.

References _m, GB(), and IsRoadDepot().

Referenced by CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanEnterNewTile(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanExitOldTile(), CmdBuildRoadVehicle(), DrawTile_Road(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::ForcedReverse(), GetAnyRoadBits(), GetDepotDirection(), RoadVehicle::GetVehicleTrackdir(), CYapfCostRoadT< Types >::PfCalcCost(), and RoadFindPathToDest().

static Owner GetRoadOwner | ( | TileIndex | t,
|  | RoadType | rt
| ) |  |
| inlinestatic

Get the owner of a specific road type.

Parameters

  t | The tile to query.
  rt | The road type to get the owner of.

Returns
  Owner of the given road type.

Definition at line 199 of file road_map.h.

References _m, _me, GB(), IsNormalRoadTile(), IsTileType(), MP_ROAD, MP_STATION, MP_TUNNELBRIDGE, OWNER_NONE, OWNER_TOWN, ROADTYPE_ROAD, and ROADTYPE_TRAM.

Referenced by AfterLoadCompanyStats(), AfterLoadGame(), CanRemoveRoadWithStop(), CheckAllowRemoveTunnelBridge(), CheckFlatLandRoadStop(), CmdBuildBridge(), CmdBuildRoad(), CmdBuildRoadStop(), CmdBuildSingleRail(), CmdRemoveRoadStop(), CmdRemoveSingleRail(), DoClearBridge(), DoClearTunnel(), FixOwnerOfRailTrack(), IsRoadOwner(), RemoveRoad(), and RemoveRoadStop().

static Roadside GetRoadside | ( | TileIndex | tile | ) |
| inlinestatic

Get the decorations of a road.

Parameters

  tile | The tile to query.

Returns
  The road decoration of the tile.

Definition at line 462 of file road_map.h.

References _me, and GB().

Referenced by DoClearBridge(), DrawRoadBits(), DrawTile_Road(), HasRoadWorks(), StartRoadWorks(), and TerminateRoadWorks().

static RoadTileType GetRoadTileType | ( | TileIndex | t | ) |
| inlinestatic

Get the type of the road tile.

Parameters

  t | Tile to query.

Precondition
  IsTileType(t, MP_ROAD)

Returns
  The road tile type.

Definition at line 35 of file road_map.h.

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

Referenced by AfterLoadGame(), CmdBuildRoad(), DrawTile_Road(), GetAnyRoadBits(), IsLevelCrossing(), IsNormalRoad(), IsRoadDepot(), and RemoveRoad().

static RoadTypes GetRoadTypes | ( | TileIndex | t | ) |
| inlinestatic

Get the present road types of a tile.

Parameters

  t | The tile to query.

Returns
  Present road types.

Definition at line 166 of file road_map.h.

References _me, and GB().

Referenced by AfterLoadCompanyStats(), CanRemoveRoadWithStop(), CheckAllowRemoveTunnelBridge(), CheckFlatLandRoadStop(), CmdBuildBridge(), CmdBuildRoad(), CmdBuildRoadStop(), CmdBuildSingleRail(), CmdBuildTunnel(), CmdRemoveRoadStop(), CmdRemoveSingleRail(), DoClearBridge(), DoClearTunnel(), DrawBridgeMiddle(), DrawTile_TunnelBridge(), FixOwnerOfRailTrack(), RoadStop::GetNextRoadStop(), HasTileRoadType(), RemoveRoad(), RemoveRoadStop(), RoadFindPathToDest(), and ShowBuildBridgeWindow().

static bool HasCrossingReservation | ( | TileIndex | t | ) |
| inlinestatic

Get the reservation state of the rail crossing.

Parameters

  t | the crossing tile

Returns
  reservation state

Precondition
  IsLevelCrossingTile(t)

Definition at line 350 of file road_map.h.

References _m, HasBit(), and IsLevelCrossingTile().

Referenced by DrawTile_Road(), GetCrossingReservationTrackBits(), RemoveRoad(), TrainController(), TryReserveRailTrack(), and UpdateLevelCrossing().

static bool HasRoadWorks | ( | TileIndex | t | ) |
| inlinestatic

Check if a tile has road works.

Parameters

  t | The tile to check.

Returns
  True if the tile has road works in progress.

Definition at line 482 of file road_map.h.

References GetRoadside(), and ROADSIDE_GRASS_ROAD_WORKS.

Referenced by CmdBuildRoad(), CmdBuildSingleRail(), DrawRoadBits(), RemoveRoad(), StartRoadWorks(), and TerminateRoadWorks().

static bool HasTileRoadType | ( | TileIndex | t,
|  | RoadType | rt
| ) |  |
| inlinestatic

Check if a tile has a specific road type.

Parameters

  t | The tile to check.
  rt | Road type to check.

Returns
  True if the tile has the specified road type.

Definition at line 188 of file road_map.h.

References GetRoadTypes(), and HasBit().

Referenced by ClearTile_Station(), CmdBuildRoad(), CmdBuildRoadVehicle(), DrawTile_Road(), GetAnyRoadBits(), GrowTownAtRoad(), HasTownOwnedRoad(), IsRoadOwner(), and RemoveRoad().

static bool HasTownOwnedRoad | ( | TileIndex | t | ) |
| inlinestatic

Checks if given tile has town owned road.

Parameters

  t | tile to check

Precondition
  IsTileType(t, MP_ROAD)

Returns
  true iff tile has road and the road is owned by a town

Definition at line 249 of file road_map.h.

References HasTileRoadType(), IsRoadOwner(), OWNER_TOWN, and ROADTYPE_ROAD.

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

static bool IncreaseRoadWorksCounter | ( | TileIndex | t | ) |
| inlinestatic

Increase the progress counter of road works.

Parameters

  t | The tile to modify.

Returns
  True if the road works are in the last stage.

Definition at line 492 of file road_map.h.

References _me, AB(), and GB().

static bool IsCrossingBarred | ( | TileIndex | t | ) |
| inlinestatic

Check if the level crossing is barred.

Parameters

  t | The tile to query.

Precondition
  IsLevelCrossing(t)

Returns
  True if the level crossing is barred.

Definition at line 386 of file road_map.h.

References _m, HasBit(), and IsLevelCrossing().

Referenced by DrawTile_Road(), RailTypeScopeResolver::GetVariable(), MaybeBarCrossingWithSound(), and UpdateLevelCrossing().

static bool IsLevelCrossing | ( | TileIndex | t | ) |
| inlinestatic

Return whether a tile is a level crossing.

Parameters

  t | Tile to query.

Precondition
  IsTileType(t, MP_ROAD)

Returns
  True if level crossing.

Definition at line 68 of file road_map.h.

References GetRoadTileType(), and ROAD_TILE_CROSSING.

Referenced by AfterLoadCompanyStats(), AfterLoadGame(), CanEnterTileOwnerCheck(), CmdBuildSingleRail(), CmdConvertRail(), CmdRemoveSingleRail(), ExploreSegment(), GetCrossingRailAxis(), GetCrossingRoadAxis(), GetGrfSpecFeature(), GetRailTrackBitsUniversal(), GetReservedTrackbits(), GetTileRailType(), IsCrossingBarred(), IsLevelCrossingTile(), CYapfCostRoadT< Types >::OneTileCost(), CYapfCostRailT< Types >::OneTileCost(), SetCrossingBarred(), TryReserveRailTrack(), and UnreserveRailTrack().

static bool IsLevelCrossingTile | ( | TileIndex | t | ) |
| inlinestatic

Return whether a tile is a level crossing tile.

Parameters

  t | Tile to query.

Returns
  True if level crossing tile.

Definition at line 78 of file road_map.h.

References IsLevelCrossing(), IsTileType(), and MP_ROAD.

Referenced by AfterLoadGame(), ChangeOwnershipOfCompanyItems(), CmdConvertRail(), DeleteLastWagon(), FixOwnerOfRailTrack(), RailTypeScopeResolver::GetVariable(), HasCrossingReservation(), SetCrossingReservation(), SetDefaultRailGui(), TrainApproachingCrossing(), TrainApproachingCrossingTile(), TrainCheckIfLineEnds(), TrainController(), and UpdateLevelCrossing().

static bool IsNormalRoad | ( | TileIndex | t | ) |
| inlinestatic

Return whether a tile is a normal road.

Parameters

  t | Tile to query.

Precondition
  IsTileType(t, MP_ROAD)

Returns
  True if normal road.

Definition at line 47 of file road_map.h.

References GetRoadTileType(), and ROAD_TILE_NORMAL.

Referenced by AfterLoadCompanyStats(), CmdBuildRoad(), CmdBuildSingleRail(), GetDisallowedRoadDirections(), GetRoadBits(), IsNormalRoadTile(), SetDisallowedRoadDirections(), and SetRoadBits().

static bool IsNormalRoadTile | ( | TileIndex | t | ) |
| inlinestatic

Return whether a tile is a normal road tile.

Parameters

  t | Tile to query.

Returns
  True if normal road tile.

Definition at line 57 of file road_map.h.

References IsNormalRoad(), IsTileType(), and MP_ROAD.

Referenced by CheckFlatLandRoadStop(), CmdBuildRoad(), CmdBuildRoadStop(), CmdTurnRoadVeh(), ConnectRoadToStructure(), DoClearBridge(), GetRoadOwner(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::GetSingleTramBit(), GetSingleTramBit(), and SetRoadOwner().

static bool IsOnSnow | ( | TileIndex | t | ) |
| inlinestatic

Check if a road tile has snow/desert.

Parameters

  t | The tile to query.

Returns
  True if the tile has snow/desert.

Definition at line 429 of file road_map.h.

References _me, and HasBit().

Referenced by DrawRoadAsSnowDesert(), and GetTerrainType().

static bool IsRoadDepot | ( | TileIndex | t | ) |
| inlinestatic

Return whether a tile is a road depot.

Parameters

  t | Tile to query.

Precondition
  IsTileType(t, MP_ROAD)

Returns
  True if road depot.

Definition at line 89 of file road_map.h.

References GetRoadTileType(), and ROAD_TILE_DEPOT.

Referenced by AfterLoadCompanyStats(), AfterLoadGame(), ClosestTownFromTile(), CmdBuildBridge(), GetRoadDepotDirection(), GetTownIndex(), GrowTownAtRoad(), IsRoadDepotTile(), NPFMarkTile(), RoadFindPathToDest(), SetTownIndex(), and UpdateNearestTownForRoadTiles().

static bool IsRoadDepotTile | ( | TileIndex | t | ) |
| inlinestatic

Return whether a tile is a road depot tile.

Parameters

  t | Tile to query.

Returns
  True if road depot tile.

Definition at line 99 of file road_map.h.

References IsRoadDepot(), IsTileType(), and MP_ROAD.

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

static bool IsRoadOwner | ( | TileIndex | t,
|  | RoadType | rt,
|  | Owner | o
| ) |  |
| inlinestatic

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

Parameters

  t | The tile to query.
  rt | The road type to compare the owner of.
  o | Owner to compare with.

Precondition
  HasTileRoadType(t, rt)

Returns
  True if the road type is owned by the given owner.

Definition at line 237 of file road_map.h.

References GetRoadOwner(), and HasTileRoadType().

Referenced by GrowTownAtRoad(), HasTownOwnedRoad(), and RemoveRoad().

static void MakeRoadCrossing | ( | TileIndex | t,
|  | Owner | road,
|  | Owner | tram,
|  | Owner | rail,
|  | Axis | roaddir,
|  | RailType | rat,
|  | RoadTypes | rot,
|  | uint | town
| ) |  |
| inlinestatic

Make a level crossing.

Parameters

  t | Tile to make a level crossing.
  road | New owner of road.
  tram | New owner of tram tracks.
  rail | New owner of the rail track.
  roaddir | Axis of the road.
  rat | New rail type.
  rot | New present road types.
  town | Town ID if the road is a town-owned road.

Definition at line 577 of file road_map.h.

References _m, _me, Tile::m2, Tile::m3, Tile::m4, Tile::m5, TileExtended::m7, MP_ROAD, ROAD_TILE_CROSSING, ROADTYPE_TRAM, SB(), SetRoadOwner(), SetTileOwner(), and SetTileType().

Referenced by CmdBuildRoad(), and CmdBuildSingleRail().

static void MakeRoadDepot | ( | TileIndex | t,
|  | Owner | owner,
|  | DepotID | did,
|  | DiagDirection | dir,
|  | RoadType | rt
| ) |  |
| inlinestatic

Make a road depot.

Parameters

  t | Tile to make a level crossing.
  owner | New owner of the depot.
  did | New depot ID.
  dir | Direction of the depot exit.
  rt | Road type of the depot.

Definition at line 598 of file road_map.h.

References _m, _me, Tile::m2, Tile::m3, Tile::m4, Tile::m5, TileExtended::m7, MP_ROAD, Window::owner, ROAD_TILE_DEPOT, ROADTYPE_TRAM, RoadTypeToRoadTypes(), SB(), SetRoadOwner(), SetTileOwner(), and SetTileType().

Referenced by CmdBuildRoadDepot().

static void MakeRoadNormal | ( | TileIndex | t,
|  | RoadBits | bits,
|  | RoadTypes | rot,
|  | TownID | town,
|  | Owner | road,
|  | Owner | tram
| ) |  |
| inlinestatic

Make a normal road tile.

Parameters

  t | Tile to make a normal road.
  bits | Road bits to set for all present road types.
  rot | New present road types.
  town | Town ID if the road is a town-owned road.
  road | New owner of road.
  tram | New owner of tram tracks.

Definition at line 553 of file road_map.h.

References _m, _me, HasBit(), Tile::m2, Tile::m3, Tile::m4, Tile::m5, TileExtended::m7, MP_ROAD, ROAD_TILE_NORMAL, ROADTYPE_ROAD, ROADTYPE_TRAM, SB(), SetRoadOwner(), SetTileOwner(), and SetTileType().

Referenced by AfterLoadGame(), CmdBuildRoad(), CmdRemoveRoadStop(), CmdRemoveSingleRail(), and FixOwnerOfRailTrack().

static void SetCrossingBarred | ( | TileIndex | t,
|  | bool | barred
| ) |  |
| inlinestatic

Set the bar state of a level crossing.

Parameters

  t | The tile to modify.
  barred | True if the crossing should be barred, false otherwise.

Precondition
  IsLevelCrossing(t)

Definition at line 398 of file road_map.h.

References _m, IsLevelCrossing(), and SB().

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

static void SetCrossingReservation | ( | TileIndex | t,
|  | bool | b
| ) |  |
| inlinestatic

Set the reservation state of the rail crossing.

Note
  Works for both waypoints and rail depots

Parameters

  t | the crossing tile
  b | the reservation state

Precondition
  IsLevelCrossingTile(t)

Definition at line 363 of file road_map.h.

References _m, IsLevelCrossingTile(), and SB().

Referenced by AfterLoadGame(), CmdBuildRoad(), TryReserveRailTrack(), and UnreserveRailTrack().

static void SetDisallowedRoadDirections | ( | TileIndex | t,
|  | DisallowedRoadDirections | drd
| ) |  |
| inlinestatic

Sets the disallowed directions.

Parameters

  t | the tile to set the directions for
  drd | the disallowed directions

Definition at line 282 of file road_map.h.

References _m, DRD_END, IsNormalRoad(), and SB().

Referenced by CmdBuildRoad(), and RemoveRoad().

static void SetRoadBits | ( | TileIndex | t,
|  | RoadBits | r,
|  | RoadType | rt
| ) |  |
| inlinestatic

Set the present road bits for a specific road type.

Parameters

  t | The tile to change.
  r | The new road bits.
  rt | Road type.

Precondition
  IsNormalRoad(t)

Definition at line 151 of file road_map.h.

References _m, IsNormalRoad(), ROADTYPE_ROAD, ROADTYPE_TRAM, and SB().

Referenced by CmdBuildRoad(), and RemoveRoad().

static void SetRoadOwner | ( | TileIndex | t,
|  | RoadType | rt,
|  | Owner | o
| ) |  |
| inlinestatic

Set the owner of a specific road type.

Parameters

  t | The tile to change.
  rt | The road type to change the owner of.
  o | New owner of the given road type.

Definition at line 220 of file road_map.h.

References _m, _me, IsNormalRoadTile(), OWNER_NONE, OWNER_TOWN, ROADTYPE_ROAD, ROADTYPE_TRAM, and SB().

Referenced by AfterLoadGame(), CmdBuildRoad(), CmdBuildSingleRail(), GrowTownAtRoad(), MakeDriveThroughRoadStop(), MakeRoadBridgeRamp(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadStop(), and MakeRoadTunnel().

static void SetRoadside | ( | TileIndex | tile,
|  | Roadside | s
| ) |  |
| inlinestatic

Set the decorations of a road.

Parameters

  tile | The tile to change.
  s | The new road decoration of the tile.

Definition at line 472 of file road_map.h.

References _me, and SB().

Referenced by DoClearBridge(), NPFMarkTile(), StartRoadWorks(), and TerminateRoadWorks().

static void SetRoadTypes | ( | TileIndex | t,
|  | RoadTypes | rt
| ) |  |
| inlinestatic

Set the present road types of a tile.

Parameters

  t | The tile to change.
  rt | The new road types.

Definition at line 176 of file road_map.h.

References _me, IsTileType(), MP_ROAD, MP_STATION, MP_TUNNELBRIDGE, and SB().

Referenced by AfterLoadGame(), CmdBuildRoad(), MakeDriveThroughRoadStop(), MakeRoadBridgeRamp(), MakeRoadStop(), MakeRoadTunnel(), and RemoveRoad().

static void StartRoadWorks | ( | TileIndex | t | ) |
| inlinestatic

Start road works on a tile.

Parameters

  t | The tile to start the work on.

Precondition
  !HasRoadWorks(t)

Definition at line 504 of file road_map.h.

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

static void TerminateRoadWorks | ( | TileIndex | t | ) |
| inlinestatic

Terminate road works on a tile.

Parameters

  t | Tile to stop the road works on.

Precondition
  HasRoadWorks(t)

Definition at line 520 of file road_map.h.

References _me, GetRoadside(), HasRoadWorks(), ROADSIDE_GRASS, ROADSIDE_GRASS_ROAD_WORKS, SB(), and SetRoadside().

static void ToggleSnow | ( | TileIndex | t | ) |
| inlinestatic

Toggle the snow/desert state of a road tile.

Parameters

  t | The tile to change.

Definition at line 440 of file road_map.h.

References _me, and ToggleBit().

static void UnbarCrossing | ( | TileIndex | t | ) |
| inlinestatic

Unbar a level crossing.

Parameters

  t | The tile to change.

Definition at line 408 of file road_map.h.

References SetCrossingBarred().