|
OpenTTD
|
Hides the direct accesses to the map array with map accessors. More...
#include "rail_type.h"#include "depot_type.h"#include "signal_func.h"#include "track_func.h"#include "tile_map.h"#include "water_map.h"#include "signal_type.h"Go to the source code of this file.
Enumerations | |
| enum | RailTileType { RAIL_TILE_NORMAL = 0, RAIL_TILE_SIGNALS = 1, RAIL_TILE_DEPOT = 3 } |
| Different types of Rail-related tiles. More... | |
| enum | RailGroundType { RAIL_GROUND_BARREN = 0, RAIL_GROUND_GRASS = 1, RAIL_GROUND_FENCE_NW = 2, RAIL_GROUND_FENCE_SE = 3, RAIL_GROUND_FENCE_SENW = 4, RAIL_GROUND_FENCE_NE = 5, RAIL_GROUND_FENCE_SW = 6, RAIL_GROUND_FENCE_NESW = 7, RAIL_GROUND_FENCE_VERT1 = 8, RAIL_GROUND_FENCE_VERT2 = 9, RAIL_GROUND_FENCE_HORIZ1 = 10, RAIL_GROUND_FENCE_HORIZ2 = 11, RAIL_GROUND_ICE_DESERT = 12, RAIL_GROUND_WATER = 13, RAIL_GROUND_HALF_SNOW = 14 } |
| The ground 'under' the rail. More... | |
Functions | |
| static RailTileType | GetRailTileType (TileIndex t) |
| Returns the RailTileType (normal with or without signals, waypoint or depot). More... | |
| static bool | IsPlainRail (TileIndex t) |
| Returns whether this is plain rails, with or without signals. More... | |
| static bool | IsPlainRailTile (TileIndex t) |
| Checks whether the tile is a rail tile or rail tile with signals. More... | |
| static bool | HasSignals (TileIndex t) |
| Checks if a rail tile has signals. More... | |
| static void | SetHasSignals (TileIndex tile, bool signals) |
| Add/remove the 'has signal' bit from the RailTileType. More... | |
| static bool | IsRailDepot (TileIndex t) |
| Is this rail tile a rail depot? More... | |
| static bool | IsRailDepotTile (TileIndex t) |
| Is this tile rail tile and a rail depot? More... | |
| static RailType | GetRailType (TileIndex t) |
| Gets the rail type of the given tile. More... | |
| static void | SetRailType (TileIndex t, RailType r) |
| Sets the rail type of the given tile. More... | |
| static TrackBits | GetTrackBits (TileIndex tile) |
| Gets the track bits of the given tile. More... | |
| static void | SetTrackBits (TileIndex t, TrackBits b) |
| Sets the track bits of the given tile. More... | |
| static bool | HasTrack (TileIndex tile, Track track) |
| Returns whether the given track is present on the given tile. More... | |
| static DiagDirection | GetRailDepotDirection (TileIndex t) |
| Returns the direction the depot is facing to. More... | |
| static Track | GetRailDepotTrack (TileIndex t) |
| Returns the track of a depot, ignoring direction. More... | |
| static TrackBits | GetRailReservationTrackBits (TileIndex t) |
| Returns the reserved track bits of the tile. More... | |
| static void | SetTrackReservation (TileIndex t, TrackBits b) |
| Sets the reserved track bits of the tile. More... | |
| static bool | TryReserveTrack (TileIndex tile, Track t) |
| Try to reserve a specific track on a tile. More... | |
| static void | UnreserveTrack (TileIndex tile, Track t) |
| Lift the reservation of a specific track on a tile. More... | |
| static bool | HasDepotReservation (TileIndex t) |
| Get the reservation state of the depot. More... | |
| static void | SetDepotReservation (TileIndex t, bool b) |
| Set the reservation state of the depot. More... | |
| static TrackBits | GetDepotReservationTrackBits (TileIndex t) |
| Get the reserved track bits for a depot. More... | |
| static bool | IsPbsSignal (SignalType s) |
| static SignalType | GetSignalType (TileIndex t, Track track) |
| static void | SetSignalType (TileIndex t, Track track, SignalType s) |
| static bool | IsPresignalEntry (TileIndex t, Track track) |
| static bool | IsPresignalExit (TileIndex t, Track track) |
| static bool | IsOnewaySignal (TileIndex t, Track track) |
| One-way signals can't be passed the 'wrong' way. More... | |
| static void | CycleSignalSide (TileIndex t, Track track) |
| static SignalVariant | GetSignalVariant (TileIndex t, Track track) |
| static void | SetSignalVariant (TileIndex t, Track track, SignalVariant v) |
| static void | SetSignalStates (TileIndex tile, uint state) |
| Set the states of the signals (Along/AgainstTrackDir) More... | |
| static uint | GetSignalStates (TileIndex tile) |
| Set the states of the signals (Along/AgainstTrackDir) More... | |
| static SignalState | GetSingleSignalState (TileIndex t, byte signalbit) |
| Get the state of a single signal. More... | |
| static void | SetPresentSignals (TileIndex tile, uint signals) |
| Set whether the given signals are present (Along/AgainstTrackDir) More... | |
| static uint | GetPresentSignals (TileIndex tile) |
| Get whether the given signals are present (Along/AgainstTrackDir) More... | |
| static bool | IsSignalPresent (TileIndex t, byte signalbit) |
| Checks whether the given signals is present. More... | |
| static bool | HasSignalOnTrack (TileIndex tile, Track track) |
| Checks for the presence of signals (either way) on the given track on the given rail tile. | |
| static bool | HasSignalOnTrackdir (TileIndex tile, Trackdir trackdir) |
| Checks for the presence of signals along the given trackdir on the given rail tile. More... | |
| static SignalState | GetSignalStateByTrackdir (TileIndex tile, Trackdir trackdir) |
| Gets the state of the signal along the given trackdir. More... | |
| static void | SetSignalStateByTrackdir (TileIndex tile, Trackdir trackdir, SignalState state) |
| Sets the state of the signal along the given trackdir. | |
| static bool | HasPbsSignalOnTrackdir (TileIndex tile, Trackdir td) |
| Is a pbs signal present along the trackdir? More... | |
| static bool | HasOnewaySignalBlockingTrackdir (TileIndex tile, Trackdir td) |
| Is a one-way signal blocking the trackdir? A one-way signal on the trackdir against will block, but signals on both trackdirs won't. More... | |
| RailType | GetTileRailType (TileIndex tile) |
| Return the rail type of tile, or INVALID_RAILTYPE if this is no rail tile. | |
| static void | SetRailGroundType (TileIndex t, RailGroundType rgt) |
| static RailGroundType | GetRailGroundType (TileIndex t) |
| static bool | IsSnowRailGround (TileIndex t) |
| static void | MakeRailNormal (TileIndex t, Owner o, TrackBits b, RailType r) |
| static void | MakeRailDepot (TileIndex t, Owner o, DepotID did, DiagDirection d, RailType r) |
Hides the direct accesses to the map array with map accessors.
Definition in file rail_map.h.
| enum RailGroundType |
The ground 'under' the rail.
Definition at line 487 of file rail_map.h.
| enum RailTileType |
Different types of Rail-related tiles.
| Enumerator | |
|---|---|
| RAIL_TILE_NORMAL | Normal rail tile without signals. |
| RAIL_TILE_SIGNALS | Normal rail tile with signals. |
| RAIL_TILE_DEPOT | Depot (one entrance) |
Definition at line 25 of file rail_map.h.
Get the reserved track bits for a depot.
| t | the tile |
Definition at line 284 of file rail_map.h.
References GetRailDepotTrack(), HasDepotReservation(), TRACK_BIT_NONE, and TrackToTrackBits().
Referenced by GetReservedTrackbits().
|
inlinestatic |
Get whether the given signals are present (Along/AgainstTrackDir)
| tile | the tile to get the present signals for |
Definition at line 395 of file rail_map.h.
Referenced by IsSignalPresent().
|
inlinestatic |
Returns the direction the depot is facing to.
| t | the tile to get the depot facing from |
Definition at line 173 of file rail_map.h.
Referenced by CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanEnterNewTile(), CmdBuildRailVehicle(), CmdBuildRailWagon(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::ForcedReverse(), GetRailDepotTrack(), Train::GetVehicleTrackdir(), TicksToLeaveDepot(), and TrainCanLeaveTile().
Returns the track of a depot, ignoring direction.
| t | the tile to get the depot track from |
Definition at line 184 of file rail_map.h.
References DiagDirToDiagTrack(), and GetRailDepotDirection().
Referenced by AdvanceWagonsAfterSwap(), CmdConvertRail(), and GetDepotReservationTrackBits().
Returns the reserved track bits of the tile.
| t | the tile to query |
Definition at line 196 of file rail_map.h.
Referenced by GetReservedTrackbits().
|
inlinestatic |
Returns the RailTileType (normal with or without signals, waypoint or depot).
| t | the tile to get the information from |
Definition at line 38 of file rail_map.h.
Referenced by CmdConvertRail(), GetAxisForNewWaypoint(), GetRailTrackBitsUniversal(), HasSignals(), IsPlainRail(), IsPossibleCrossing(), IsRailDepot(), and PlaceExtraDepotRail().
Gets the rail type of the given tile.
| t | the tile to get the rail type from |
Definition at line 117 of file rail_map.h.
Referenced by CmdBuildRailVehicle(), CmdBuildRailWagon(), CmdConvertRail(), DrawBridgeMiddle(), DrawTile_Road(), DrawTile_TunnelBridge(), DrawTrackBits(), Train::GetMaxTrackSpeed(), Train::GetPower(), Train::GetPoweredPartPower(), GetPylonBase(), GetRailTrackBitsUniversal(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::GetSpeedLimit(), GetTileRailType(), and GetWireBase().
|
inlinestatic |
Gets the state of the signal along the given trackdir.
Along meaning if you are currently driving on the given trackdir, this is the signal that is facing us (for which we stop when it's red).
Definition at line 440 of file rail_map.h.
|
inlinestatic |
Set the states of the signals (Along/AgainstTrackDir)
| tile | the tile to set the states for |
Definition at line 364 of file rail_map.h.
Referenced by GetSingleSignalState(), and SetSignalStateByTrackdir().
|
inlinestatic |
Get the state of a single signal.
| t | the tile to get the signal state for |
| signalbit | the signal |
Definition at line 375 of file rail_map.h.
References GetSignalStates(), and HasBit().
Gets the track bits of the given tile.
| tile | the tile to get the track bits from |
Definition at line 138 of file rail_map.h.
Referenced by CheckTrackCombination(), CmdConvertRail(), GetAxisForNewWaypoint(), GetRailTrackBitsUniversal(), HasTrack(), IsPossibleCrossing(), PlaceExtraDepotRail(), and CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::QueryNewTileTrackStatus().
|
inlinestatic |
Get the reservation state of the depot.
| t | the depot tile |
Definition at line 260 of file rail_map.h.
Referenced by CheckTrainStayInDepot(), and GetDepotReservationTrackBits().
Is a one-way signal blocking the trackdir? A one-way signal on the trackdir against will block, but signals on both trackdirs won't.
| tile | the tile to check |
| td | the trackdir to check |
Definition at line 477 of file rail_map.h.
References GetTileRailType(), HasSignalOnTrackdir(), IsOnewaySignal(), IsTileType(), MP_RAILWAY, ReverseTrackdir(), and TrackdirToTrack().
Referenced by ExtendTrainReservation(), and FollowReservation().
Is a pbs signal present along the trackdir?
| tile | the tile to check |
| td | the trackdir to check |
Definition at line 465 of file rail_map.h.
References HasSignalOnTrackdir(), IsTileType(), and MP_RAILWAY.
Checks for the presence of signals along the given trackdir on the given rail tile.
Along meaning if you are currently driving on the given trackdir, this is the signal that is facing us (for which we stop when it's red).
Definition at line 428 of file rail_map.h.
Referenced by FollowReservation(), HasOnewaySignalBlockingTrackdir(), HasPbsSignalOnTrackdir(), IsSafeWaitingPosition(), and IsWaitingPositionFree().
|
inlinestatic |
Checks if a rail tile has signals.
| t | the tile to get the information from |
Definition at line 74 of file rail_map.h.
References GetRailTileType(), and RAIL_TILE_SIGNALS.
Referenced by CheckTrackCombination().
Returns whether the given track is present on the given tile.
| tile | the tile to check the track presence of |
| track | the track to search for on the tile |
Definition at line 162 of file rail_map.h.
References GetTrackBits(), and HasBit().
One-way signals can't be passed the 'wrong' way.
Definition at line 321 of file rail_map.h.
Referenced by HasOnewaySignalBlockingTrackdir().
|
inlinestatic |
Returns whether this is plain rails, with or without signals.
Iow, if this tiles RailTileType is RAIL_TILE_NORMAL or RAIL_TILE_SIGNALS.
| t | the tile to get the information from |
Definition at line 51 of file rail_map.h.
References GetRailTileType(), RAIL_TILE_NORMAL, and RAIL_TILE_SIGNALS.
Referenced by CheckTrackCombination(), ExtendTrainReservation(), GetReservedTrackbits(), and IsPlainRailTile().
|
inlinestatic |
Checks whether the tile is a rail tile or rail tile with signals.
| t | the tile to get the information from |
Definition at line 62 of file rail_map.h.
References IsPlainRail(), IsTileType(), and MP_RAILWAY.
Referenced by CmdConvertRail(), MaskWireBits(), and CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::QueryNewTileTrackStatus().
|
inlinestatic |
Is this rail tile a rail depot?
| t | the tile to get the information from |
Definition at line 97 of file rail_map.h.
References GetRailTileType(), and RAIL_TILE_DEPOT.
Referenced by DrawRailCatenary(), GetReservedTrackbits(), and IsRailDepotTile().
|
inlinestatic |
Is this tile rail tile and a rail depot?
| t | the tile to get the information from |
Definition at line 107 of file rail_map.h.
References IsRailDepot(), IsTileType(), and MP_RAILWAY.
Referenced by FollowReservation(), IsDepotTile(), IsSafeWaitingPosition(), IsWaitingPositionFree(), CYapfDestinationAnyDepotRailT< Types >::PfDetectDestination(), ReverseTrainDirection(), and TrainCanLeaveTile().
|
inlinestatic |
Checks whether the given signals is present.
| t | the tile to check on |
| signalbit | the signal |
Definition at line 406 of file rail_map.h.
References GetPresentSignals(), and HasBit().
|
inlinestatic |
Set the reservation state of the depot.
| t | the depot tile |
| b | the reservation state |
Definition at line 272 of file rail_map.h.
|
inlinestatic |
Add/remove the 'has signal' bit from the RailTileType.
| tile | the tile to add/remove the signals to/from |
| signals | whether the rail tile should have signals or not |
Definition at line 85 of file rail_map.h.
|
inlinestatic |
Set whether the given signals are present (Along/AgainstTrackDir)
| tile | the tile to set the present signals for |
| signals | the signals that have to be present |
Definition at line 385 of file rail_map.h.
Sets the rail type of the given tile.
| t | the tile to set the rail type of |
| r | the new rail type for the tile |
Definition at line 127 of file rail_map.h.
Referenced by CmdConvertRail(), and MakeRailBridgeRamp().
|
inlinestatic |
Set the states of the signals (Along/AgainstTrackDir)
| tile | the tile to set the states for |
| state | the new state |
Definition at line 354 of file rail_map.h.
Referenced by SetSignalStateByTrackdir().
Sets the track bits of the given tile.
| t | the tile to set the track bits of |
| b | the new track bits for the tile |
Definition at line 149 of file rail_map.h.
Sets the reserved track bits of the tile.
| t | the tile to change |
| b | the track bits |
Definition at line 211 of file rail_map.h.
Try to reserve a specific track on a tile.
| tile | the tile |
| t | the rack to reserve |
Definition at line 228 of file rail_map.h.
Lift the reservation of a specific track on a tile.
| tile | the tile |
| t | the track to free |
Definition at line 246 of file rail_map.h.