OpenTTD AI API
20241117-master-ga6c526cfa0
|
Class that handles all tunnel related functions. More...
Public Types | |
enum | ErrorMessages { ERR_TUNNEL_BASE , ERR_TUNNEL_CANNOT_BUILD_ON_WATER , ERR_TUNNEL_START_SITE_UNSUITABLE , ERR_TUNNEL_ANOTHER_TUNNEL_IN_THE_WAY , ERR_TUNNEL_END_SITE_UNSUITABLE } |
All tunnel related errors. More... | |
Static Public Member Functions | |
static bool | IsTunnelTile (TileIndex tile) |
Check whether the tile is an entrance to a tunnel. More... | |
static TileIndex | GetOtherTunnelEnd (TileIndex tile) |
Get the tile that exits on the other end of a (would be) tunnel starting at tile. More... | |
static bool | BuildTunnel (AIVehicle::VehicleType vehicle_type, TileIndex start) |
Builds a tunnel starting at start. More... | |
static bool | RemoveTunnel (TileIndex tile) |
Remove the tunnel whose entrance is located at tile. More... | |
Class that handles all tunnel related functions.
All tunnel related errors.
|
static |
Builds a tunnel starting at start.
The direction of the tunnel depends on the slope of the start tile. Tunnels can be created for either rails or roads; use the appropriate AIVehicle::VehicleType. As an extra for road, this functions builds two half-pieces of road on each end of the tunnel, making it easier for you to connect it to your network.
start | Where to start the tunnel. |
vehicle_type | The vehicle-type of tunnel to build. |
Get the tile that exits on the other end of a (would be) tunnel starting at tile.
If there is no 'simple' inclined slope at the start tile, this function will return AIMap::TILE_INVALID.
tile | The tile that is an entrance to a tunnel or the tile where you may want to build a tunnel. |
|
static |
Check whether the tile is an entrance to a tunnel.
tile | The tile to check. |
|
static |
Remove the tunnel whose entrance is located at tile.
tile | The tile that is an entrance to a tunnel. |
AIError::ERR_OWNED_BY_ANOTHER_COMPANY |