Functions that have tunnels and bridges in common. More...
#include "bridge_map.h"
#include "tunnel_map.h"
Go to the source code of this file.
Functions | |
static DiagDirection | GetTunnelBridgeDirection (TileIndex t) |
Get the direction pointing to the other end. | |
static TransportType | GetTunnelBridgeTransportType (TileIndex t) |
Tunnel: Get the transport type of the tunnel (road or rail) Bridge: Get the transport type of the bridge's ramp. | |
static bool | HasTunnelBridgeSnowOrDesert (TileIndex t) |
Tunnel: Is this tunnel entrance in a snowy or desert area? Bridge: Does the bridge ramp lie in a snow or desert area? | |
static void | SetTunnelBridgeSnowOrDesert (TileIndex t, bool snow_or_desert) |
Tunnel: Places this tunnel entrance in a snowy or desert area, or takes it out of there. | |
static TileIndex | GetOtherTunnelBridgeEnd (TileIndex t) |
Determines type of the wormhole and returns its other end. | |
static bool | HasTunnelBridgeReservation (TileIndex t) |
Get the reservation state of the rail tunnel/bridge. | |
static void | SetTunnelBridgeReservation (TileIndex t, bool b) |
Set the reservation state of the rail tunnel/bridge. | |
static TrackBits | GetTunnelBridgeReservationTrackBits (TileIndex t) |
Get the reserved track bits for a rail tunnel/bridge. | |
static void | SetBitTunnelBridgeSignal (TileIndex t) |
Declare tunnel/bridge with signal simulation. | |
static void | ClrBitTunnelBridgeSignal (TileIndex t) |
Remove tunnel/bridge with signal simulation. | |
static void | SetBitTunnelBridgeExit (TileIndex t) |
Declare tunnel/bridge exit. | |
static void | ClrBitTunnelBridgeExit (TileIndex t) |
Remove tunnel/bridge exit declaration. | |
static bool | HasWormholeSignals (TileIndex t) |
Is this a tunnel/bridge pair with signal simulation? On tunnel/bridge pair minimal one of the two bits is set. | |
static bool | IsTunnelBridgeWithSignGreen (TileIndex t) |
Is this a tunnel/bridge with sign on green? | |
static bool | IsTunnelBridgeWithSignRed (TileIndex t) |
static bool | IsTunnelBridgeEntrance (TileIndex t) |
Is this a tunnel/bridge entrance tile with signal? Tunnel bridge signal simulation has allways bit 5 on at entrance. | |
static bool | IsTunnelBridgeExit (TileIndex t) |
Is this a tunnel/bridge exit? |
Functions that have tunnels and bridges in common.
Definition in file tunnelbridge_map.h.
static void ClrBitTunnelBridgeExit | ( | TileIndex | t | ) | [inline, static] |
Remove tunnel/bridge exit declaration.
t | the tunnel/bridge tile. |
Definition at line 158 of file tunnelbridge_map.h.
References _m, ClrBit(), IsTileType(), and MP_TUNNELBRIDGE.
Referenced by CmdBuildSingleSignal(), and CmdRemoveSingleSignal().
static void ClrBitTunnelBridgeSignal | ( | TileIndex | t | ) | [inline, static] |
Remove tunnel/bridge with signal simulation.
t | the tunnel/bridge tile. |
Definition at line 138 of file tunnelbridge_map.h.
References _m, ClrBit(), IsTileType(), and MP_TUNNELBRIDGE.
Referenced by CmdBuildSingleSignal(), and CmdRemoveSingleSignal().
Determines type of the wormhole and returns its other end.
t | one end |
Definition at line 80 of file tunnelbridge_map.h.
References GetOtherBridgeEnd(), GetOtherTunnelEnd(), IsTileType(), IsTunnel(), and MP_TUNNELBRIDGE.
Referenced by AfterLoadGame(), CcBuildRoadTunnel(), CheckTrainCollision(), ClearPathReservation(), CmdBuildRoad(), CmdBuildSingleSignal(), CmdConvertRail(), CmdRemoveSingleSignal(), Train::Crash(), ExploreSegment(), FollowTrainReservation(), GetTrainForReservation(), GrowTownInTile(), PlaceRail_Bridge(), PlaceRoad_Bridge(), RemoveRoad(), UpdateSignalsInBuffer(), and YapfTrainCheckReverse().
static DiagDirection GetTunnelBridgeDirection | ( | TileIndex | t | ) | [inline, static] |
Get the direction pointing to the other end.
Tunnel: Get the direction facing into the tunnel Bridge: Get the direction pointing onto the bridge
t | The tile to analyze |
Definition at line 28 of file tunnelbridge_map.h.
References _m, GB(), IsTileType(), and MP_TUNNELBRIDGE.
Referenced by AdjustTileh(), AfterLoadGame(), CanEnterTile(), CcBuildBridge(), CcBuildRoadTunnel(), ClearPathReservation(), CmdBuildBridge(), CmdBuildLongRoad(), CmdBuildRoad(), CmdBuildSingleSignal(), CmdConvertRail(), CmdSignalTrackHelper(), CmdTurnRoadVeh(), CollectTrackbitsFromCrashedVehiclesEnum(), CopyPaste::CopyArea(), DeleteLastWagon(), DeleteVisibleTrain(), DoClearBridge(), DoClearTunnel(), DrawCatenaryOnTunnel(), DrawCatenaryRailway(), DrawTile_TunnelBridge(), ExploreSegment(), GetAnyRoadBits(), GetBridgeEnd(), GetBridgeHeight(), GetOtherBridgeEnd(), GetOtherTunnelEnd(), GetRailTrackBitsUniversal(), GetTunnelBridgeReservationTrackBits(), IsTunnelInWayDir(), IsWaterCrossingTunnel(), IsWateredTile(), RemoveRoad(), Train::ReserveTrackUnderConsist(), CYapfCostBase::stSlopeCost(), TrainCanLeaveTile(), UpdateSignalsInBuffer(), and YapfTrainCheckReverse().
Get the reserved track bits for a rail tunnel/bridge.
t | the tile |
Definition at line 119 of file tunnelbridge_map.h.
References DiagDirToDiagTrackBits(), GetTunnelBridgeDirection(), and HasTunnelBridgeReservation().
Referenced by GetReservedTrackbits(), and TryReserveRailTrack().
static TransportType GetTunnelBridgeTransportType | ( | TileIndex | t | ) | [inline, static] |
Tunnel: Get the transport type of the tunnel (road or rail) Bridge: Get the transport type of the bridge's ramp.
t | The tile to analyze |
Definition at line 41 of file tunnelbridge_map.h.
References _m, GB(), IsTileType(), and MP_TUNNELBRIDGE.
Referenced by AfterLoadGame(), CanEnterTileOwnerCheck(), CheckAllowRemoveTunnelBridge(), CmdBuildBridge(), CmdBuildRoad(), CmdBuildSingleSignal(), CmdConvertRail(), CmdRemoveSingleSignal(), CopyPaste::CopyArea(), DoClearBridge(), DoClearTunnel(), DrawBridgeMiddle(), DrawTile_TunnelBridge(), ExploreSegment(), GetAnyRoadBits(), GetReservedTrackbits(), GetTileRailType(), GrowTownInTile(), HasTunnelBridgeReservation(), IsWateredTile(), RemoveRoad(), SetDefaultRailGui(), SetTunnelBridgeReservation(), TryReserveRailTrack(), UnreserveRailTrack(), and UpdateSignalsInBuffer().
static bool HasTunnelBridgeReservation | ( | TileIndex | t | ) | [inline, static] |
Get the reservation state of the rail tunnel/bridge.
t | the tile |
Definition at line 93 of file tunnelbridge_map.h.
References _m, GetTunnelBridgeTransportType(), HasBit(), IsTileType(), MP_TUNNELBRIDGE, and TRANSPORT_RAIL.
Referenced by CmdBuildBridge(), CmdConvertRail(), DoClearBridge(), DoClearTunnel(), DrawTile_TunnelBridge(), and GetTunnelBridgeReservationTrackBits().
static bool HasTunnelBridgeSnowOrDesert | ( | TileIndex | t | ) | [inline, static] |
Tunnel: Is this tunnel entrance in a snowy or desert area? Bridge: Does the bridge ramp lie in a snow or desert area?
t | The tile to analyze |
Definition at line 54 of file tunnelbridge_map.h.
References _me, HasBit(), IsTileType(), and MP_TUNNELBRIDGE.
Referenced by DrawTile_TunnelBridge(), and GetTerrainType().
static bool HasWormholeSignals | ( | TileIndex | t | ) | [inline, static] |
Is this a tunnel/bridge pair with signal simulation? On tunnel/bridge pair minimal one of the two bits is set.
t | the tile that might be a tunnel/bridge. |
Definition at line 170 of file tunnelbridge_map.h.
References _m, HasBit(), IsTileType(), and MP_TUNNELBRIDGE.
Referenced by ClearPathReservation(), CmdBuildSingleSignal(), CmdRemoveSingleSignal(), DrawBridgeMiddle(), DrawTile_TunnelBridge(), ExploreSegment(), and UpdateSignalsInBuffer().
static bool IsTunnelBridgeEntrance | ( | TileIndex | t | ) | [inline, static] |
Is this a tunnel/bridge entrance tile with signal? Tunnel bridge signal simulation has allways bit 5 on at entrance.
t | the tile that might be a tunnel/bridge. |
Definition at line 199 of file tunnelbridge_map.h.
References _m, HasBit(), IsTileType(), and MP_TUNNELBRIDGE.
Referenced by CmdBuildSingleSignal(), and DrawTile_TunnelBridge().
static bool IsTunnelBridgeExit | ( | TileIndex | t | ) | [inline, static] |
Is this a tunnel/bridge exit?
t | the tile that might be a tunnel/bridge. |
Definition at line 210 of file tunnelbridge_map.h.
References _m, HasBit(), IsTileType(), and MP_TUNNELBRIDGE.
Referenced by CheckTrainStayInWormHole(), DrawBridgeMiddle(), and ExploreSegment().
static bool IsTunnelBridgeWithSignGreen | ( | TileIndex | t | ) | [inline, static] |
Is this a tunnel/bridge with sign on green?
t | the tile that might be a tunnel/bridge with sign set green. |
Definition at line 181 of file tunnelbridge_map.h.
References _m, HasBit(), IsTileType(), and MP_TUNNELBRIDGE.
static void SetBitTunnelBridgeExit | ( | TileIndex | t | ) | [inline, static] |
Declare tunnel/bridge exit.
t | the tunnel/bridge tile. |
Definition at line 148 of file tunnelbridge_map.h.
References _m, IsTileType(), MP_TUNNELBRIDGE, and SetBit().
Referenced by CmdBuildSingleSignal().
static void SetBitTunnelBridgeSignal | ( | TileIndex | t | ) | [inline, static] |
Declare tunnel/bridge with signal simulation.
t | the tunnel/bridge tile. |
Definition at line 128 of file tunnelbridge_map.h.
References _m, IsTileType(), MP_TUNNELBRIDGE, and SetBit().
Referenced by CmdBuildSingleSignal().
static void SetTunnelBridgeReservation | ( | TileIndex | t, | |
bool | b | |||
) | [inline, static] |
Set the reservation state of the rail tunnel/bridge.
t | the tile | |
b | the reservation state |
Definition at line 106 of file tunnelbridge_map.h.
References _m, GetTunnelBridgeTransportType(), IsTileType(), MP_TUNNELBRIDGE, SB(), and TRANSPORT_RAIL.
Referenced by AfterLoadGame(), ClearPathReservation(), CmdBuildBridge(), Train::Crash(), TryReserveRailTrack(), and UnreserveRailTrack().
static void SetTunnelBridgeSnowOrDesert | ( | TileIndex | t, | |
bool | snow_or_desert | |||
) | [inline, static] |
Tunnel: Places this tunnel entrance in a snowy or desert area, or takes it out of there.
Bridge: Sets whether the bridge ramp lies in a snow or desert area.
t | the tunnel entrance / bridge ramp tile | |
snow_or_desert | is the entrance/ramp in snow or desert (true), when not in snow and not in desert false |
Definition at line 68 of file tunnelbridge_map.h.
References _me, IsTileType(), MP_TUNNELBRIDGE, and SB().