|
OpenTTD Source 20260711-master-g3fb3006dff
|
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"#include "road_type.h"Go to the source code of this file.
Enumerations | |
| enum class | RoadTileType : uint8_t { Normal = 0 , Crossing = 1 , Depot = 2 } |
| The different types of road tiles. More... | |
| enum class | Roadside : uint8_t { Barren = 0 , Grass = 1 , Paved = 2 , StreetLights = 3 , Trees = 5 , GrassRoadWorks = 6 , PavedRoadWorks = 7 } |
| The possible road side decorations. More... | |
Functions | |
| bool | MayHaveRoad (Tile t) |
| Test whether a tile can have road/tram types. | |
| static RoadTileType | GetRoadTileType (Tile t) |
| Get the type of the road tile. | |
| static bool | IsNormalRoad (Tile t) |
| Return whether a tile is a normal road. | |
| static bool | IsNormalRoadTile (Tile t) |
| Return whether a tile is a normal road tile. | |
| bool | IsLevelCrossing (Tile t) |
| Return whether a tile is a level crossing. | |
| bool | IsLevelCrossingTile (Tile t) |
| Return whether a tile is a level crossing tile. | |
| static bool | IsRoadDepot (Tile t) |
| Return whether a tile is a road depot. | |
| static bool | IsRoadDepotTile (Tile t) |
| Return whether a tile is a road depot tile. | |
| RoadBits | GetRoadBits (Tile t, RoadTramType rtt) |
| Get the present road bits for a specific road type. | |
| RoadBits | GetAllRoadBits (Tile tile) |
| Get all set RoadBits on the given tile. | |
| void | SetRoadBits (Tile t, RoadBits r, RoadTramType rtt) |
| Set the present road bits for a specific road type. | |
| RoadType | GetRoadTypeRoad (Tile t) |
| Get the road type for RoadTramType being RoadTramType::Road. | |
| RoadType | GetRoadTypeTram (Tile t) |
| Get the road type for RoadTramType being RoadTramType::Tram. | |
| RoadType | GetRoadType (Tile t, RoadTramType rtt) |
| Get the road type for the given RoadTramType. | |
| RoadTypes | GetPresentRoadTypes (Tile t) |
| Get the present road types of a tile. | |
| bool | HasRoadTypeRoad (Tile t) |
| Check if a tile has a road type when RoadTramType is RoadTramType::Road. | |
| bool | HasRoadTypeTram (Tile t) |
| Check if a tile has a road type when RoadTramType is RoadTramType::Tram. | |
| bool | HasTileRoadType (Tile t, RoadTramType rtt) |
| Check if a tile has a road or a tram road type. | |
| bool | HasTileAnyRoadType (Tile t, RoadTypes rts) |
| Check if a tile has one of the specified road types. | |
| Owner | GetRoadOwner (Tile t, RoadTramType rtt) |
| Get the owner of a specific road type. | |
| void | SetRoadOwner (Tile t, RoadTramType rtt, Owner o) |
| Set the owner of a specific road type. | |
| bool | IsRoadOwner (Tile t, RoadTramType rtt, Owner o) |
| Check if a specific road type is owned by an owner. | |
| bool | HasTownOwnedRoad (Tile t) |
| Checks if given tile has town owned road. | |
| bool | IsValidDisallowedRoadDirections (DisallowedRoadDirections drt) |
| Checks if a DisallowedRoadDirections is valid. | |
| DisallowedRoadDirections | GetDisallowedRoadDirections (Tile t) |
| Gets the disallowed directions. | |
| void | SetDisallowedRoadDirections (Tile t, DisallowedRoadDirections drd) |
| Sets the disallowed directions. | |
| Axis | GetCrossingRoadAxis (Tile t) |
| Get the road axis of a level crossing. | |
| Axis | GetCrossingRailAxis (Tile t) |
| Get the rail axis of a level crossing. | |
| RoadBits | GetCrossingRoadBits (Tile tile) |
| Get the road bits of a level crossing. | |
| Track | GetCrossingRailTrack (Tile tile) |
| Get the rail track of a level crossing. | |
| bool | HasCrossingReservation (Tile t) |
| Get the reservation state of the rail crossing. | |
| void | SetCrossingReservation (Tile t, bool b) |
| Set the reservation state of the rail crossing. | |
| TrackBits | GetCrossingReservationTrackBits (Tile t) |
| Get the reserved track bits for a rail crossing. | |
| bool | IsCrossingBarred (Tile t) |
| Check if the level crossing is barred. | |
| void | SetCrossingBarred (Tile t, bool barred) |
| Set the bar state of a level crossing. | |
| void | UnbarCrossing (Tile t) |
| Unbar a level crossing. | |
| void | BarCrossing (Tile t) |
| Bar a level crossing. | |
| bool | IsOnSnowOrDesert (Tile t) |
| Check if a road tile has snow/desert. | |
| void | ToggleSnowOrDesert (Tile t) |
| Toggle the snow/desert state of a road tile. | |
| Roadside | GetRoadside (Tile tile) |
| Get the decorations of a road. | |
| void | SetRoadside (Tile tile, Roadside s) |
| Set the decorations of a road. | |
| bool | HasRoadWorks (Tile t) |
| Check if a tile has road works. | |
| bool | IncreaseRoadWorksCounter (Tile t) |
| Increase the progress counter of road works. | |
| void | StartRoadWorks (Tile t) |
| Start road works on a tile. | |
| void | TerminateRoadWorks (Tile t) |
| Terminate road works on a tile. | |
| DiagDirection | GetRoadDepotDirection (Tile t) |
| Get the direction of the exit of a road depot. | |
| RoadBits | GetAnyRoadBits (Tile tile, RoadTramType rtt, bool straight_tunnel_bridge_entrance=false) |
| Returns the RoadBits on an arbitrary tile Special behaviour: | |
| void | SetRoadTypeRoad (Tile t, RoadType rt) |
| Set the road road type of a tile. | |
| void | SetRoadTypeTram (Tile t, RoadType rt) |
| Set the tram road type of a tile. | |
| void | SetRoadType (Tile t, RoadTramType rtt, RoadType rt) |
| Set the road type of a tile. | |
| void | SetRoadTypes (Tile t, RoadType road_rt, RoadType tram_rt) |
| Set the present road types of a tile. | |
| void | MakeRoadNormal (Tile t, RoadBits bits, RoadType road_rt, RoadType tram_rt, TownID town, Owner road, Owner tram) |
| Make a normal road tile. | |
| void | MakeRoadCrossing (Tile t, Owner road, Owner tram, Owner rail, Axis roaddir, RailType rat, RoadType road_rt, RoadType tram_rt, TownID town) |
| Make a level crossing. | |
| void | SetRoadDepotExitDirection (Tile tile, DiagDirection dir) |
| Sets the exit direction of a road depot. | |
| void | MakeRoadDepot (Tile tile, Owner owner, DepotID depot_id, DiagDirection dir, RoadType rt) |
| Make a road depot. | |
Map accessors for roads.
Definition in file road_map.h.
|
strong |
The possible road side decorations.
Definition at line 472 of file road_map.h.
|
strong |
The different types of road tiles.
| Enumerator | |
|---|---|
| Normal | Normal road. |
| Crossing | Level crossing. |
| Depot | Depot (one entrance). |
Definition at line 22 of file road_map.h.
|
inline |
Bar a level crossing.
| t | The tile to change. |
Definition at line 446 of file road_map.h.
References SetCrossingBarred().
Get all set RoadBits on the given tile.
| tile | The tile from which we want to get the RoadBits |
Definition at line 125 of file road_map.h.
References GetRoadBits(), Road, and Tram.
Referenced by CheckFlatLandRoadStop(), ClearTile_Road(), DrawTile_Road(), GetAxisForNewRoadWaypoint(), GetFoundation_Road(), GetSlopePixelZ_Road(), TerraformTile_Road(), and TileLoop_Road().
| RoadBits GetAnyRoadBits | ( | Tile | tile, |
| RoadTramType | rtt, | ||
| bool | straight_tunnel_bridge_entrance ) |
Returns the RoadBits on an arbitrary tile Special behaviour:
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.
| tile | the tile to get the road bits for |
| rtt | the road type to get the road bits form |
| straight_tunnel_bridge_entrance | whether to return straight road bits for tunnels/bridges. |
Definition at line 54 of file road_map.cpp.
References AxisToRoadBits(), Crossing, Depot, DiagDirToAxis(), DiagDirToRoadBits(), GetBayRoadStopDir(), GetCrossingRoadBits(), GetDriveThroughStopAxis(), GetRoadBits(), GetRoadDepotDirection(), GetRoadTileType(), GetTileType(), GetTunnelBridgeDirection(), GetTunnelBridgeTransportType(), HasTileRoadType(), IsAnyRoadStopTile(), IsDriveThroughStopTile(), MayHaveRoad(), Normal, ReverseDiagDir(), Road, Station, and TunnelBridge.
Referenced by CanConnectToRoad(), CanRemoveRoadWithStop(), CheckAllowRemoveRoad(), CleanUpRoadBits(), CmdBuildRoad(), CmdConvertRoad(), GetTownRoadBits(), RoadFindPathToDest(), and TileLoop_Road().
Get the rail axis of a level crossing.
| t | The tile to query. |
Definition at line 347 of file road_map.h.
References GetCrossingRoadAxis(), IsLevelCrossing(), and OtherAxis().
Referenced by DrawTile_Road(), GetCrossingRailTrack(), and TrainApproachingCrossing().
Get the rail track of a level crossing.
| tile | The tile to query. |
Definition at line 368 of file road_map.h.
References AxisToTrack(), and GetCrossingRailAxis().
Referenced by ChangeTileOwner_Road(), CmdBuildSingleRail(), CmdConvertRail(), CmdRemoveSingleRail(), GetCrossingReservationTrackBits(), GetRailTrackBitsUniversal(), GetTileTrackStatus_Road(), and RemoveRoad().
Get the reserved track bits for a rail crossing.
| t | the tile |
Definition at line 404 of file road_map.h.
References GetCrossingRailTrack(), and HasCrossingReservation().
Referenced by GetReservedTrackbits().
Get the road axis of a level crossing.
| t | The tile to query. |
Definition at line 335 of file road_map.h.
References GB(), IsLevelCrossing(), and Tile::m5().
Referenced by CmdBuildRoad(), CmdBuildSingleRail(), CmdRemoveSingleRail(), DrawTile_Road(), ExploreSegment(), GetCrossingRailAxis(), GetCrossingRoadBits(), GetTileTrackStatus_Road(), MarkDirtyAdjacentLevelCrossingTiles(), RemoveRoad(), TrainApproachingCrossingTile(), UpdateAdjacentLevelCrossingTilesOnLevelCrossingRemoval(), and UpdateLevelCrossing().
Get the road bits of a level crossing.
| tile | The tile to query. |
Definition at line 358 of file road_map.h.
References AxisToRoadBits(), and GetCrossingRoadAxis().
Referenced by ClearTile_Road(), CmdBuildRoad(), CmdRemoveSingleRail(), DrawRoadCatenary(), FixOwnerOfRailTrack(), GetAnyRoadBits(), and RemoveRoad().
|
inline |
Gets the disallowed directions.
| t | the tile to get the directions from |
Definition at line 311 of file road_map.h.
References GB(), IsNormalRoad(), and Tile::m5().
Referenced by CheckFlatLandRoadStop(), CmdBuildRoad(), CmdBuildSingleRail(), CmdTurnRoadVeh(), DrawRoadBits(), GetTileTrackStatus_Road(), and GrowTownWithBridge().
Get the present road types of a tile.
| t | The tile to query. |
Definition at line 185 of file road_map.h.
References GetRoadTypeRoad(), GetRoadTypeTram(), INVALID_ROADTYPE, MayHaveRoad(), and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set().
Referenced by HasTileAnyRoadType().
|
inline |
Get the present road bits for a specific road type.
| t | The tile to query. |
| rtt | Road type. |
Definition at line 112 of file road_map.h.
References GB(), IsNormalRoad(), Tile::m3(), Tile::m5(), and Tram.
Referenced by AfterLoadCompanyStats(), ChangeTileOwner_Road(), CheckFlatLandRoadStop(), ClearTile_Road(), CmdBuildRoad(), CmdBuildRoadStop(), CmdBuildRoadWaypoint(), CmdBuildSingleRail(), ConnectRoadToStructure(), DrawRoadBits(), DrawRoadCatenary(), GetAllRoadBits(), GetAnyRoadBits(), CFollowTrackT< TransportType::Water, Ship, true >::GetSingleTramBit(), GetTileTrackStatus_Road(), GetTrackdirBitsForRoad(), and RemoveRoad().
|
inline |
Get the direction of the exit of a road depot.
| t | The tile to query. |
Definition at line 565 of file road_map.h.
References GB(), IsRoadDepot(), and Tile::m5().
Referenced by CFollowTrackT< TransportType::Water, Ship, true >::CanEnterNewTile(), CFollowTrackT< TransportType::Water, Ship, true >::CanExitOldTile(), CanRoadContinueIntoNextTile(), CmdBuildRoadDepot(), CmdBuildRoadVehicle(), DrawTile_Road(), CFollowTrackT< TransportType::Water, Ship, true >::ForcedReverse(), GetAnyRoadBits(), GetTileTrackStatus_Road(), RoadVehicle::GetVehicleTrackdir(), CYapfCostRoadT< Types >::PfCalcCost(), RoadFindPathToDest(), TerraformTile_Road(), and VehicleEnterTile_Road().
|
inline |
Get the owner of a specific road type.
| t | The tile to query. |
| rtt | RoadTramType. |
Definition at line 244 of file road_map.h.
References GB(), IsNormalRoadTile(), Tile::m1(), Tile::m3(), Tile::m7(), MayHaveRoad(), OWNER_NONE, OWNER_TOWN, and Road.
Referenced by AfterLoadCompanyStats(), AfterLoadGame(), CanRemoveRoadWithStop(), ChangeTileOwner_Road(), ChangeTileOwner_Station(), ChangeTileOwner_TunnelBridge(), CheckAllowRemoveTunnelBridge(), CheckFlatLandRoadStop(), CmdBuildBridge(), CmdBuildRoad(), CmdBuildRoadStop(), CmdBuildRoadWaypoint(), CmdBuildSingleRail(), CmdConvertRoad(), CmdRemoveSingleRail(), DoClearBridge(), DoClearTunnel(), DrawRoadTypeCatenary(), FixOwnerOfRailTrack(), GetSmallMapOwnerPixels(), GetTileDesc_Road(), GetTileDesc_TunnelBridge(), IsRoadOwner(), RemoveGenericRoadStop(), RemoveRoad(), RemoveRoadStop(), RemoveRoadWaypointStop(), and TileLoop_Road().
Get the decorations of a road.
| tile | The tile to query. |
Definition at line 488 of file road_map.h.
References GB(), and Tile::m6().
Referenced by DoClearBridge(), DrawRoadBits(), DrawTile_Road(), GetTileDesc_Road(), HasRoadWorks(), StartRoadWorks(), TerminateRoadWorks(), and TileLoop_Road().
|
inlinestatic |
Get the type of the road tile.
| t | Tile to query. |
Definition at line 36 of file road_map.h.
References debug_inline, GB(), IsTileType(), Tile::m5(), and Road.
Referenced by AfterLoadGame(), ClearTile_Road(), CmdBuildRoad(), DrawTile_Road(), GetAnyRoadBits(), GetTileDesc_Road(), GetTileTrackStatus_Road(), IsLevelCrossing(), IsNormalRoad(), IsRoadDepot(), RemoveRoad(), TerraformTile_Road(), and VehicleEnterTile_Road().
|
inline |
Get the road type for the given RoadTramType.
| t | The tile to query. |
| rtt | The sub type to check for. |
Definition at line 175 of file road_map.h.
References GetRoadTypeRoad(), GetRoadTypeTram(), and Tram.
Referenced by AfterLoadCompanyStats(), AfterLoadVehiclesPhase2(), CanConnectToRoad(), CFollowTrackT< TransportType::Water, Ship, true >::CanEnterNewTile(), ChangeTileOwner_Road(), ChangeTileOwner_Station(), ChangeTileOwner_TunnelBridge(), CheckFlatLandRoadStop(), ClearTile_Road(), CmdBuildRoad(), CmdBuildRoadStop(), CmdBuildRoadWaypoint(), CmdConvertRoad(), NIHRoadType< TRoadTramType >::GetBadges(), RoadVehicle::GetMaxTrackSpeed(), CFollowTrackT< TransportType::Water, Ship, true >::GetSpeedLimit(), RoadStopScopeResolver::GetVariable(), HasTileRoadType(), RemoveGenericRoadStop(), RemoveRoad(), RemoveRoadStop(), and RemoveRoadWaypointStop().
Get the road type for RoadTramType being RoadTramType::Road.
| t | The tile to query. |
Definition at line 152 of file road_map.h.
References GB(), Tile::m4(), and MayHaveRoad().
Referenced by CanRemoveRoadWithStop(), ChangeTileOwner_Road(), CheckAllowRemoveTunnelBridge(), CmdBuildBridge(), CmdBuildRoadDepot(), CmdBuildSingleRail(), CmdRemoveSingleRail(), ConvertRoadTypes(), DoClearBridge(), DoClearTunnel(), DrawBridgeRoadBits(), DrawRoadBits(), DrawRoadCatenary(), DrawRoadTypeCatenary(), DrawTile_Road(), DrawTile_Station(), DrawTile_TunnelBridge(), GetPresentRoadTypes(), GetRoadType(), GetSmallMapRoutesPixels(), GetTileDesc_Road(), GetTileDesc_TunnelBridge(), GetTrackTypes(), HasRoadTypeRoad(), RoadTypesAllowHouseHere(), ShowBuildBridgeWindow(), TileLoop_Road(), TownCanGrowRoad(), TunnelBridgeClearCost(), and BuildVehicleWindow::UpdateFilterByTile().
Get the road type for RoadTramType being RoadTramType::Tram.
| t | The tile to query. |
Definition at line 163 of file road_map.h.
References GB(), Tile::m8(), and MayHaveRoad().
Referenced by CanRemoveRoadWithStop(), ChangeTileOwner_Road(), CheckAllowRemoveTunnelBridge(), CmdBuildBridge(), CmdBuildRoadDepot(), CmdBuildSingleRail(), CmdRemoveSingleRail(), ConvertRoadTypes(), DoClearBridge(), DoClearTunnel(), DrawBridgeRoadBits(), DrawRoadBits(), DrawRoadCatenary(), DrawRoadTypeCatenary(), DrawTile_Road(), DrawTile_Station(), DrawTile_TunnelBridge(), GetPresentRoadTypes(), GetRoadType(), GetSmallMapRoutesPixels(), GetTileDesc_Road(), GetTileDesc_TunnelBridge(), GetTrackTypes(), HasRoadTypeTram(), ShowBuildBridgeWindow(), TunnelBridgeClearCost(), and BuildVehicleWindow::UpdateFilterByTile().
|
inline |
Get the reservation state of the rail crossing.
| t | the crossing tile |
Definition at line 379 of file road_map.h.
References HasBit(), IsLevelCrossingTile(), and Tile::m5().
Referenced by CheckLevelCrossing(), DrawTile_Road(), GetCrossingReservationTrackBits(), RemoveRoad(), TrainController(), and TryReserveRailTrack().
|
inline |
Check if a tile has a road type when RoadTramType is RoadTramType::Road.
| t | The tile to check. |
Definition at line 200 of file road_map.h.
References GetRoadTypeRoad(), and INVALID_ROADTYPE.
Referenced by GetSmallMapOwnerPixels().
|
inline |
Check if a tile has a road type when RoadTramType is RoadTramType::Tram.
| t | The tile to check. |
Definition at line 210 of file road_map.h.
References GetRoadTypeTram(), and INVALID_ROADTYPE.
Referenced by CmdBuildRoadDepot().
|
inline |
Check if a tile has road works.
| t | The tile to check. |
Definition at line 508 of file road_map.h.
References GetRoadside(), and GrassRoadWorks.
Referenced by CmdBuildRoad(), CmdBuildSingleRail(), DrawRoadBits(), GetTileTrackStatus_Road(), RemoveRoad(), StartRoadWorks(), TerminateRoadWorks(), and TileLoop_Road().
Check if a tile has one of the specified road types.
| t | The tile to check. |
| rts | Allowed road types. |
Definition at line 232 of file road_map.h.
References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Any(), GetPresentRoadTypes(), and MayHaveRoad().
Referenced by CheckRoadBlockedForOvertaking(), CmdBuildRoadVehicle(), RoadStop::GetNextRoadStop(), Station::GetPrimaryRoadStop(), and GetVehicleCannotUseStationReason().
|
inline |
Check if a tile has a road or a tram road type.
| t | The tile to check. |
| rtt | The road type. |
Definition at line 221 of file road_map.h.
References GetRoadType(), and INVALID_ROADTYPE.
Referenced by ClearTile_Station(), CmdBuildRoad(), GetAnyRoadBits(), GetTileTrackStatus_Road(), GetTileTrackStatus_Station(), GetTileTrackStatus_TunnelBridge(), GrowTownAtRoad(), HasTownOwnedRoad(), and IsRoadOwner().
|
inline |
Checks if given tile has town owned road.
| t | tile to check |
Definition at line 290 of file road_map.h.
References HasTileRoadType(), IsRoadOwner(), OWNER_TOWN, and Road.
Referenced by AfterLoadGame(), ClosestTownFromTile(), CmdDeleteTown(), UpdateNearestTownForRoadTiles(), and Town::~Town().
|
inline |
Increase the progress counter of road works.
| t | The tile to modify. |
Definition at line 518 of file road_map.h.
References AB(), GB(), and Tile::m7().
Referenced by TileLoop_Road().
|
inline |
Check if the level crossing is barred.
| t | The tile to query. |
Definition at line 415 of file road_map.h.
References HasBit(), IsLevelCrossing(), and Tile::m5().
Referenced by DrawTile_Road(), GetTileTrackStatus_Road(), RailTypeScopeResolver::GetVariable(), RoadTypeScopeResolver::GetVariable(), MaybeBarCrossingWithSound(), UpdateAdjacentLevelCrossingTilesOnLevelCrossingRemoval(), and UpdateLevelCrossingTile().
|
inline |
Return whether a tile is a level crossing.
| t | Tile to query. |
Definition at line 69 of file road_map.h.
References Crossing, and GetRoadTileType().
Referenced by AfterLoadCompanyStats(), AfterLoadGame(), ChangeTileOwner_Road(), CmdBuildSingleRail(), CmdConvertRail(), CmdConvertRoad(), CmdRemoveSingleRail(), ConvertRailTypes(), DrawRoadCatenary(), ExploreSegment(), GetCrossingRailAxis(), GetCrossingRoadAxis(), GetGrfSpecFeature(), GetRailTrackBitsUniversal(), GetReservedTrackbits(), GetTileRailType(), GetTileTrackStatus_Road(), IsCrossingBarred(), IsLevelCrossingTile(), CYapfCostRailT< Types >::OneTileCost(), CYapfCostRoadT< Types >::OneTileCost(), SetCrossingBarred(), TryReserveRailTrack(), and UnreserveRailTrack().
|
inline |
Return whether a tile is a level crossing tile.
| t | Tile to query. |
Definition at line 79 of file road_map.h.
References IsLevelCrossing(), IsTileType(), and Road.
Referenced by AfterLoadGame(), ChangeOwnershipOfCompanyItems(), CmdConvertRail(), DeleteLastWagon(), DrawTile_Road(), FixOwnerOfRailTrack(), GetTileTrackStatus_Road(), RailTypeScopeResolver::GetVariable(), RoadTypeScopeResolver::GetVariable(), HasCrossingReservation(), MarkDirtyAdjacentLevelCrossingTiles(), SetCrossingReservation(), TrainApproachingCrossing(), TrainApproachingCrossingTile(), TrainCheckIfLineEnds(), TrainController(), TrainOnCrossing(), UpdateAdjacentLevelCrossingTilesOnLevelCrossingRemoval(), UpdateLevelCrossing(), and UpdateLevelCrossingTile().
|
inlinestatic |
Return whether a tile is a normal road.
| t | Tile to query. |
Definition at line 48 of file road_map.h.
References debug_inline, GetRoadTileType(), and Normal.
Referenced by AfterLoadCompanyStats(), CmdBuildRoad(), CmdBuildSingleRail(), DrawRoadCatenary(), GetDisallowedRoadDirections(), GetFoundation_Road(), GetRoadBits(), GetSlopePixelZ_Road(), IsNormalRoadTile(), SetDisallowedRoadDirections(), SetRoadBits(), and TileLoop_Road().
|
inlinestatic |
Return whether a tile is a normal road tile.
| t | Tile to query. |
Definition at line 58 of file road_map.h.
References debug_inline, IsNormalRoad(), IsTileType(), and Road.
Referenced by CheckFlatLandRoadStop(), CleanUpRoadBits(), CmdBuildRoad(), CmdBuildRoadStop(), CmdBuildRoadWaypoint(), CmdTurnRoadVeh(), ConnectRoadToStructure(), DoClearBridge(), GetAxisForNewRoadWaypoint(), GetRoadOwner(), CFollowTrackT< TransportType::Water, Ship, true >::GetSingleTramBit(), GetTrackdirBitsForRoad(), GrowTownWithBridge(), and SetRoadOwner().
|
inline |
Check if a road tile has snow/desert.
| t | The tile to query. |
Definition at line 456 of file road_map.h.
References HasBit(), and Tile::m7().
Referenced by DrawRoadBits(), DrawTile_Road(), GetTerrainType(), and TileLoop_Road().
|
inlinestatic |
Return whether a tile is a road depot.
| t | Tile to query. |
Definition at line 90 of file road_map.h.
References debug_inline, Depot, and GetRoadTileType().
Referenced by AfterLoadCompanyStats(), AfterLoadGame(), CanRoadContinueIntoNextTile(), ChangeTileOwner_Road(), CheckBuildAbove_Road(), ClickTile_Road(), ClosestTownFromTile(), CmdConvertRoad(), GetRoadDepotDirection(), GetTownIndex(), GrowTownAtRoad(), IsRoadDepotTile(), RoadFindPathToDest(), SetTownIndex(), TileLoop_Road(), and UpdateNearestTownForRoadTiles().
|
inlinestatic |
Return whether a tile is a road depot tile.
| t | Tile to query. |
Definition at line 100 of file road_map.h.
References debug_inline, IsRoadDepot(), IsTileType(), and Road.
Referenced by CmdBuildRoadDepot(), CmdConvertRoad(), CmdInsertOrder(), GetDepotIndex(), GetTownRoadBits(), RoadTypeScopeResolver::GetVariable(), IsDepotTile(), IsDepotTypeTile(), CYapfCostRoadT< Types >::PfCalcCost(), CYapfDestinationAnyDepotRoadT< Types >::PfDetectDestination(), CYapfDestinationAnyDepotRoadT< Types >::PfDetectDestinationTile(), and SetRoadDepotExitDirection().
|
inline |
Check if a specific road type is owned by an owner.
| t | The tile to query. |
| rtt | Road type to check. |
| o | Owner to compare with. |
Definition at line 278 of file road_map.h.
References GetRoadOwner(), and HasTileRoadType().
Referenced by GrowTownAtRoad(), HasTownOwnedRoad(), and RemoveRoad().
|
inline |
Checks if a DisallowedRoadDirections is valid.
| drt | The value to check |
Definition at line 301 of file road_map.h.
References None, Northbound, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Reset(), and Southbound.
Referenced by CmdBuildLongRoad(), CmdBuildRoad(), and SetDisallowedRoadDirections().
|
inline |
Make a level crossing.
| 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. |
| road_rt | The road roadtype to set for the tile. |
| tram_rt | The tram roadtype to set for the tile. |
| town | Town ID if the road is a town-owned road. |
Definition at line 661 of file road_map.h.
References Crossing, INVALID_ROADTYPE, Tile::m2(), Tile::m3(), Tile::m4(), Tile::m5(), Tile::m6(), Tile::m7(), Tile::m8(), Road, SB(), SetRoadOwner(), SetRoadTypes(), SetTileOwner(), SetTileType(), to_underlying(), and Tram.
Referenced by CmdBuildRoad(), and CmdBuildSingleRail().
|
inline |
Make a road depot.
| tile | Tile to make a depot on. |
| owner | New owner of the depot. |
| depot_id | New depot ID. |
| dir | Direction of the depot exit. |
| rt | Road type of the depot. |
Definition at line 695 of file road_map.h.
References Depot, INVALID_ROADTYPE, Tile::m2(), Tile::m3(), Tile::m4(), Tile::m5(), Tile::m6(), Tile::m7(), Tile::m8(), Road, SB(), SetRoadOwner(), SetRoadType(), SetTileOwner(), SetTileType(), to_underlying(), and Tram.
Referenced by CmdBuildRoadDepot().
|
inline |
Make a normal road tile.
| t | Tile to make a normal road. |
| bits | Road bits to set for all present road types. |
| road_rt | The road roadtype to set for the tile. |
| tram_rt | The tram roadtype to set for the tile. |
| 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 635 of file road_map.h.
References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), INVALID_ROADTYPE, Tile::m2(), Tile::m3(), Tile::m5(), Tile::m6(), Tile::m7(), Tile::m8(), Normal, Road, SB(), SetRoadOwner(), SetRoadTypes(), SetTileOwner(), SetTileType(), to_underlying(), and Tram.
Referenced by CmdBuildRoad(), CmdRemoveSingleRail(), and RemoveGenericRoadStop().
| bool MayHaveRoad | ( | Tile | t | ) |
Test whether a tile can have road/tram types.
| t | Tile to query. |
Definition at line 21 of file road_map.cpp.
References GetTileType(), GetTunnelBridgeTransportType(), IsAnyRoadStop(), Road, Station, and TunnelBridge.
Referenced by CanConnectToRoad(), ClearTile_Road(), CmdBuildRoadStop(), CmdBuildRoadWaypoint(), CmdConvertRoad(), DrawRoadTypeCatenary(), GetAnyRoadBits(), GetPresentRoadTypes(), GetRoadOwner(), GetRoadTypeRoad(), GetRoadTypeTram(), GetTrackTypes(), HasTileAnyRoadType(), RemoveRoad(), SetRoadTypeRoad(), and SetRoadTypeTram().
|
inline |
Set the bar state of a level crossing.
| t | The tile to modify. |
| barred | True if the crossing should be barred, false otherwise. |
Definition at line 427 of file road_map.h.
References AssignBit(), IsLevelCrossing(), and Tile::m5().
Referenced by BarCrossing(), UnbarCrossing(), UpdateAdjacentLevelCrossingTilesOnLevelCrossingRemoval(), and UpdateLevelCrossingTile().
|
inline |
Set the reservation state of the rail crossing.
| t | the crossing tile |
| b | the reservation state |
Definition at line 392 of file road_map.h.
References AssignBit(), IsLevelCrossingTile(), and Tile::m5().
Referenced by AfterLoadGame(), CmdBuildRoad(), MaybeBarCrossingWithSound(), TryReserveRailTrack(), and UnreserveRailTrack().
|
inline |
Sets the disallowed directions.
| t | the tile to set the directions for |
| drd | the disallowed directions |
Definition at line 322 of file road_map.h.
References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), IsNormalRoad(), IsValidDisallowedRoadDirections(), Tile::m5(), and SB().
Referenced by CmdBuildRoad(), and RemoveRoad().
|
inline |
Set the present road bits for a specific road type.
| t | The tile to change. |
| r | The new road bits. |
| rtt | Road type. |
Definition at line 137 of file road_map.h.
References BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), IsNormalRoad(), Tile::m3(), Tile::m5(), SB(), and Tram.
Referenced by CmdBuildRoad(), and RemoveRoad().
|
inline |
Sets the exit direction of a road depot.
Definition at line 681 of file road_map.h.
References IsRoadDepotTile(), Tile::m5(), SB(), and to_underlying().
Referenced by CmdBuildRoadDepot().
|
inline |
Set the owner of a specific road type.
| t | The tile to change. |
| rtt | RoadTramType. |
| o | New owner of the given road type. |
Definition at line 261 of file road_map.h.
References IsNormalRoadTile(), Tile::m1(), Tile::m3(), Tile::m7(), OWNER_NONE, OWNER_TOWN, Road, and SB().
Referenced by AfterLoadGame(), ChangeTileOwner_Road(), ChangeTileOwner_Station(), ChangeTileOwner_TunnelBridge(), CmdBuildRoad(), ConvertRoadTypeOwner(), FixOwnerOfRailTrack(), GrowTownAtRoad(), MakeDriveThroughRoadStop(), MakeRoadBridgeRamp(), MakeRoadCrossing(), MakeRoadDepot(), MakeRoadNormal(), MakeRoadStop(), and MakeRoadTunnel().
Set the decorations of a road.
| tile | The tile to change. |
| s | The new road decoration of the tile. |
Definition at line 498 of file road_map.h.
References Tile::m6(), SB(), and to_underlying().
Referenced by DoClearBridge(), StartRoadWorks(), TerminateRoadWorks(), and TileLoop_Road().
|
inline |
Set the road type of a tile.
| t | The tile to change. |
| rtt | Set road or tram type. |
| rt | The road type to set. |
Definition at line 604 of file road_map.h.
References SetRoadTypeRoad(), SetRoadTypeTram(), and Tram.
Referenced by CmdBuildRoad(), CmdConvertRoad(), MakeRoadDepot(), RemoveRoad(), and TileLoop_Road().
Set the road road type of a tile.
| t | The tile to change. |
| rt | The road type to set. |
Definition at line 579 of file road_map.h.
References INVALID_ROADTYPE, Tile::m4(), MayHaveRoad(), and SB().
Referenced by ConvertRoadTypes(), SetRoadType(), and SetRoadTypes().
Set the present road types of a tile.
| t | The tile to change. |
| road_rt | The road roadtype to set for the tile. |
| tram_rt | The tram roadtype to set for the tile. |
Definition at line 619 of file road_map.h.
References SetRoadTypeRoad(), and SetRoadTypeTram().
Referenced by AfterLoadGame(), MakeDriveThroughRoadStop(), MakeRoadBridgeRamp(), MakeRoadCrossing(), MakeRoadNormal(), MakeRoadStop(), and MakeRoadTunnel().
Set the tram road type of a tile.
| t | The tile to change. |
| rt | The road type to set. |
Definition at line 591 of file road_map.h.
References INVALID_ROADTYPE, Tile::m8(), MayHaveRoad(), and SB().
Referenced by ConvertRoadTypes(), SetRoadType(), and SetRoadTypes().
|
inline |
Start road works on a tile.
| t | The tile to start the work on. |
Definition at line 530 of file road_map.h.
References Barren, GetRoadside(), Grass, GrassRoadWorks, HasRoadWorks(), PavedRoadWorks, and SetRoadside().
Referenced by TileLoop_Road().
|
inline |
Terminate road works on a tile.
| t | Tile to stop the road works on. |
Definition at line 551 of file road_map.h.
References GetRoadside(), Grass, GrassRoadWorks, HasRoadWorks(), Tile::m7(), Paved, SB(), and SetRoadside().
Referenced by TileLoop_Road().
|
inline |
Toggle the snow/desert state of a road tile.
| t | The tile to change. |
Definition at line 465 of file road_map.h.
References Tile::m7(), and ToggleBit().
Referenced by TileLoop_Road().
|
inline |
Unbar a level crossing.
| t | The tile to change. |
Definition at line 437 of file road_map.h.
References SetCrossingBarred().