|
OpenTTD GameScript API 20251104-master-g6d5f150b3d
|
Class that handles all tunnel related functions. More...
#include <script_tunnel.hpp>
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. | |
| static TileIndex | GetOtherTunnelEnd (TileIndex tile) |
| Get the tile that exits on the other end of a (would be) tunnel starting at tile. | |
| static bool | BuildTunnel (GSVehicle::VehicleType vehicle_type, TileIndex start) |
| Builds a tunnel starting at start. | |
| static bool | RemoveTunnel (TileIndex tile) |
| Remove the tunnel whose entrance is located at tile. | |
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 GSVehicle::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 GSMap::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. |
| GSError::ERR_OWNED_BY_ANOTHER_COMPANY |