OpenTTD Source 20241224-master-gf74b0cf984
|
Map accessors for tunnels. More...
Go to the source code of this file.
Functions | |
bool | IsTunnel (Tile t) |
Is this a tunnel (entrance)? | |
bool | IsTunnelTile (Tile t) |
Is this a tunnel (entrance)? | |
TileIndex | GetOtherTunnelEnd (TileIndex) |
Gets the other end of the tunnel. | |
bool | IsTunnelInWay (TileIndex, int z) |
Is there a tunnel in the way in any direction? | |
bool | IsTunnelInWayDir (TileIndex tile, int z, DiagDirection dir) |
Is there a tunnel in the way in the given direction? | |
void | MakeRoadTunnel (Tile t, Owner o, DiagDirection d, RoadType road_rt, RoadType tram_rt) |
Makes a road tunnel entrance. | |
void | MakeRailTunnel (Tile t, Owner o, DiagDirection d, RailType r) |
Makes a rail tunnel entrance. | |
Map accessors for tunnels.
Definition in file tunnel_map.h.
Gets the other end of the tunnel.
Where a vehicle would reappear when it enters at the given tile.
tile | the tile to search from. |
Definition at line 22 of file tunnel_map.cpp.
References GetTileZ(), GetTunnelBridgeDirection(), IsTunnelTile(), ReverseDiagDir(), and TileOffsByDiagDir().
Referenced by DoClearTunnel(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::FollowTileExit(), and GetOtherTunnelBridgeEnd().
|
inline |
Is this a tunnel (entrance)?
t | the tile that might be a tunnel |
Definition at line 23 of file tunnel_map.h.
References HasBit(), IsTileType(), Tile::m5(), and MP_TUNNELBRIDGE.
Referenced by AdjustTileh(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::CanEnterNewTile(), ClearTile_TunnelBridge(), CmdBuildBridge(), DrawTile_TunnelBridge(), CFollowTrackT< Ttr_type_, VehicleType, T90deg_turns_allowed_, Tmask_reserved_tracks >::FollowTileExit(), GetOtherTunnelBridgeEnd(), GetRailTrackBitsUniversal(), IsTunnelTile(), and TrainController().
bool IsTunnelInWay | ( | TileIndex | tile, |
int | z | ||
) |
Is there a tunnel in the way in any direction?
tile | the tile to search from. |
z | the 'z' to search on. |
Definition at line 68 of file tunnel_map.cpp.
References DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_SE, DIAGDIR_SW, IsTunnelInWayDir(), Map::MaxX(), Map::MaxY(), TileX(), and TileY().
Referenced by CmdTerraformLand().
bool IsTunnelInWayDir | ( | TileIndex | tile, |
int | z, | ||
DiagDirection | dir | ||
) |
Is there a tunnel in the way in the given direction?
tile | the tile to search from. |
z | the 'z' to search on. |
dir | the direction to start searching to. |
Definition at line 48 of file tunnel_map.cpp.
References GetTileZ(), GetTunnelBridgeDirection(), IsTunnelTile(), IsValidTile(), and TileOffsByDiagDir().
Referenced by CmdBuildTunnel(), and IsTunnelInWay().
|
inline |
Is this a tunnel (entrance)?
t | the tile that might be a tunnel |
Definition at line 34 of file tunnel_map.h.
References IsTileType(), IsTunnel(), and MP_TUNNELBRIDGE.
Referenced by AfterLoadGame(), DrawRailCatenaryRailway(), GetOtherTunnelEnd(), IsTunnelInWayDir(), Vehicle::ShowVisualEffect(), and CYapfCostBase::stSlopeCost().
|
inline |
Makes a rail tunnel entrance.
t | the entrance of the tunnel |
o | the owner of the entrance |
d | the direction facing out of the tunnel |
r | the rail type used in the tunnel |
Definition at line 73 of file tunnel_map.h.
References INVALID_ROADTYPE, Tile::m2(), Tile::m3(), Tile::m4(), Tile::m5(), Tile::m6(), Tile::m7(), Tile::m8(), MP_TUNNELBRIDGE, SB(), SetRailType(), SetRoadTypes(), SetTileOwner(), SetTileType(), and TRANSPORT_RAIL.
Referenced by CmdBuildTunnel().
|
inline |
Makes a road tunnel entrance.
t | the entrance of the tunnel |
o | the owner of the entrance |
d | the direction facing out of the tunnel |
r | the road type used in the tunnel |
Definition at line 50 of file tunnel_map.h.
References Tile::m2(), Tile::m3(), Tile::m4(), Tile::m5(), Tile::m6(), Tile::m7(), Tile::m8(), MP_TUNNELBRIDGE, OWNER_TOWN, SB(), SetRoadOwner(), SetRoadTypes(), SetTileOwner(), SetTileType(), and TRANSPORT_ROAD.
Referenced by CmdBuildTunnel().