|
OpenTTD GameScript API 20251027-master-gb43cdcba01
|
Class that handles all marine related functions. More...
#include <script_marine.hpp>
Public Types | |
| enum | ErrorMessages { ERR_MARINE_BASE , ERR_MARINE_MUST_BE_BUILT_ON_WATER } |
| All marine related error messages. More... | |
| enum | BuildType { BT_DOCK , BT_DEPOT , BT_BUOY , BT_LOCK , BT_CANAL } |
| Types of water-related objects in the game. More... | |
Static Public Member Functions | |
| static bool | IsWaterDepotTile (TileIndex tile) |
| Checks whether the given tile is actually a tile with a water depot. | |
| static bool | IsDockTile (TileIndex tile) |
| Checks whether the given tile is actually a tile with a dock. | |
| static bool | IsBuoyTile (TileIndex tile) |
| Checks whether the given tile is actually a tile with a buoy. | |
| static bool | IsLockTile (TileIndex tile) |
| Checks whether the given tile is actually a tile with a lock. | |
| static bool | IsCanalTile (TileIndex tile) |
| Checks whether the given tile is actually a tile with a canal. | |
| static bool | AreWaterTilesConnected (TileIndex tile_from, TileIndex tile_to) |
| Checks whether the given tiles are directly connected, i.e. | |
| static bool | BuildWaterDepot (TileIndex tile, TileIndex front) |
| Builds a water depot on tile. | |
| static bool | BuildDock (TileIndex tile, StationID station_id) |
| Builds a dock where tile is the tile still on land. | |
| static bool | BuildBuoy (TileIndex tile) |
| Builds a buoy on tile. | |
| static bool | BuildLock (TileIndex tile) |
| Builds a lock on tile. | |
| static bool | BuildCanal (TileIndex tile) |
| Builds a canal on tile. | |
| static bool | RemoveWaterDepot (TileIndex tile) |
| Removes a water depot. | |
| static bool | RemoveDock (TileIndex tile) |
| Removes a dock. | |
| static bool | RemoveBuoy (TileIndex tile) |
| Removes a buoy. | |
| static bool | RemoveLock (TileIndex tile) |
| Removes a lock. | |
| static bool | RemoveCanal (TileIndex tile) |
| Removes a canal. | |
| static Money | GetBuildCost (BuildType build_type) |
| Get the baseprice of building a water-related object. | |
Class that handles all marine related functions.
| enum GSMarine::BuildType |
All marine related error messages.
| Enumerator | |
|---|---|
| ERR_MARINE_BASE | Base for marine related errors. |
| ERR_MARINE_MUST_BE_BUILT_ON_WATER | Infrastructure must be built on water. |
Checks whether the given tiles are directly connected, i.e.
whether a ship vehicle can travel from the center of the first tile to the center of the second tile.
| tile_from | The source tile. |
| tile_to | The destination tile. |
|
static |
Builds a buoy on tile.
| tile | The tile where the buoy will be build. |
| GSError::ERR_AREA_NOT_CLEAR | |
| GSError::ERR_SITE_UNSUITABLE | |
| GSStation::ERR_STATION_TOO_MANY_STATIONS | |
| GSError::ERR_BRIDGE_TOO_LOW | |
| GSError::ERR_STATION_TOO_SPREAD_OUT |
|
static |
Builds a canal on tile.
| tile | The tile where the canal will be build. |
| GSError::ERR_AREA_NOT_CLEAR | |
| GSError::ERR_LAND_SLOPED_WRONG | |
| GSError::ERR_OWNED_BY_ANOTHER_COMPANY | |
| GSError::ERR_ALREADY_BUILT |
Builds a dock where tile is the tile still on land.
| tile | The tile still on land of the dock. |
| station_id | The station to join, GSStation::STATION_NEW or GSStation::STATION_JOIN_ADJACENT. |
| GSError::ERR_AREA_NOT_CLEAR | |
| GSError::ERR_SITE_UNSUITABLE | |
| GSStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION | |
| GSStation::ERR_STATION_TOO_MANY_STATIONS | |
| GSError::ERR_STATION_TOO_SPREAD_OUT |
|
static |
Builds a lock on tile.
| tile | The tile where the lock will be build. |
Builds a water depot on tile.
| tile | The tile where the water depot will be build. |
| front | A tile on the same axis with 'tile' as the depot shall be oriented. |
| GSError::ERR_AREA_NOT_CLEAR | |
| GSError::ERR_SITE_UNSUITABLE | |
| GSMarine::ERR_MARINE_MUST_BE_BUILT_ON_WATER |
Get the baseprice of building a water-related object.
| build_type | the type of object to build |
|
static |
Checks whether the given tile is actually a tile with a buoy.
| tile | The tile to check. |
|
static |
Checks whether the given tile is actually a tile with a canal.
| tile | The tile to check. |
|
static |
Checks whether the given tile is actually a tile with a dock.
| tile | The tile to check. |
|
static |
Checks whether the given tile is actually a tile with a lock.
| tile | The tile to check. |
|
static |
Checks whether the given tile is actually a tile with a water depot.
| tile | The tile to check. |
|
static |
Removes a buoy.
| tile | Any tile of the buoy. |
| GSError::ERR_OWNED_BY_ANOTHER_COMPANY |
|
static |
Removes a canal.
| tile | Any tile of the canal. |
| GSError::ERR_OWNED_BY_ANOTHER_COMPANY |
|
static |
Removes a dock.
| tile | Any tile of the dock. |
| GSError::ERR_OWNED_BY_ANOTHER_COMPANY |
|
static |
Removes a lock.
| tile | Any tile of the lock. |
| GSError::ERR_OWNED_BY_ANOTHER_COMPANY |
|
static |
Removes a water depot.
| tile | Any tile of the water depot. |
| GSError::ERR_OWNED_BY_ANOTHER_COMPANY |