Map accessors for tunnels. More...
#include "stdafx.h"
#include "tunnelbridge_map.h"
#include "station_map.h"
Go to the source code of this file.
Functions | |
TileIndex | GetOtherTunnelEnd (TileIndex tile) |
Gets the other end of the tunnel. | |
bool | IsWaterCrossingTunnel (TileIndex tile, DiagDirection dir) |
Helper function for under_water tunnel finding. | |
bool | IsTunnelInWayDir (TileIndex tile, uint z, DiagDirection dir) |
Is there a tunnel in the way in the given direction? | |
bool | IsTunnelInWay (TileIndex tile, uint z) |
Is there a tunnel in the way in any direction? | |
bool | IsTunnelBelow (TileIndex tile) |
Map accessors for tunnels.
Definition in file tunnel_map.cpp.
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 23 of file tunnel_map.cpp.
References GetTileZ(), GetTunnelBridgeDirection(), IsTunnelTile(), ReverseDiagDir(), and TileOffsByDiagDir().
Referenced by DoClearTunnel(), and GetOtherTunnelBridgeEnd().
bool IsTunnelInWay | ( | TileIndex | tile, | |
uint | 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 106 of file tunnel_map.cpp.
References DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_SE, DIAGDIR_SW, IsTunnelInWayDir(), MapMaxX(), MapMaxY(), TileX(), and TileY().
Referenced by CmdTerraformLand().
bool IsTunnelInWayDir | ( | TileIndex | tile, | |
uint | 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 73 of file tunnel_map.cpp.
References GetInclinedSlopeDirection(), GetTileMaxZ(), GetTileSlope(), GetTileZ(), GetTunnelBridgeDirection(), IsBuoyTile(), IsTileType(), IsTunnelTile(), IsValidTile(), IsWaterCrossingTunnel(), MP_WATER, ReverseDiagDir(), and TileOffsByDiagDir().
Referenced by CmdBuildTunnel(), and IsTunnelInWay().
bool IsWaterCrossingTunnel | ( | TileIndex | tile, | |
DiagDirection | dir | |||
) |
Helper function for under_water tunnel finding.
Only one strech of water is allowed to be passed.
tile | Tile to be validated. |
Definition at line 48 of file tunnel_map.cpp.
References GetTileZ(), GetTunnelBridgeDirection(), IsTunnelTile(), IsValidTile(), and TileOffsByDiagDir().
Referenced by IsTunnelInWayDir().