tunnelbridge_map.h File Reference

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.

Detailed Description

Functions that have tunnels and bridges in common.

Definition in file tunnelbridge_map.h.


Function Documentation

static TileIndex GetOtherTunnelBridgeEnd ( TileIndex  t  )  [inline, static]
static DiagDirection GetTunnelBridgeDirection ( TileIndex  t  )  [inline, static]
static TrackBits GetTunnelBridgeReservationTrackBits ( TileIndex  t  )  [inline, static]

Get the reserved track bits for a rail tunnel/bridge.

Precondition:
IsTileType(t, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL
Parameters:
t the tile
Returns:
reserved track bits

Definition at line 119 of file tunnelbridge_map.h.

References DiagDirToDiagTrackBits(), GetTunnelBridgeDirection(), HasTunnelBridgeReservation(), and TRACK_BIT_NONE.

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.

Parameters:
t The tile to analyze
Precondition:
IsTileType(t, MP_TUNNELBRIDGE)
Returns:
the transport type in the tunnel/bridge

Definition at line 41 of file tunnelbridge_map.h.

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

Referenced by AfterLoadGame(), CanEnterTileOwnerCheck(), CheckAllowRemoveTunnelBridge(), CmdBuildBridge(), CmdBuildRoad(), CmdConvertRail(), 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.

Precondition:
IsTileType(t, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL
Parameters:
t the tile
Returns:
reservation state

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?

Parameters:
t The tile to analyze
Precondition:
IsTileType(t, MP_TUNNELBRIDGE)
Returns:
true if and only if the tile is in a snowy/desert area

Definition at line 54 of file tunnelbridge_map.h.

References _me, HasBit(), IsTileType(), and MP_TUNNELBRIDGE.

Referenced by DrawTile_TunnelBridge(), and GetTerrainType().

static void SetTunnelBridgeReservation ( TileIndex  t,
bool  b 
) [inline, static]

Set the reservation state of the rail tunnel/bridge.

Precondition:
IsTileType(t, MP_TUNNELBRIDGE) && GetTunnelBridgeTransportType(t) == TRANSPORT_RAIL
Parameters:
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.

Parameters:
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
Precondition:
IsTileType(t, MP_TUNNELBRIDGE)

Definition at line 68 of file tunnelbridge_map.h.

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


Generated on Sun May 8 07:30:44 2011 for OpenTTD by  doxygen 1.6.1