OpenTTD AI API 20241224-master-gee860a5c8e
|
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 AIMarine::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. |
AIError::ERR_AREA_NOT_CLEAR | |
AIError::ERR_SITE_UNSUITABLE | |
AIStation::ERR_STATION_TOO_MANY_STATIONS |
|
static |
Builds a canal on tile.
tile | The tile where the canal will be build. |
AIError::ERR_AREA_NOT_CLEAR | |
AIError::ERR_LAND_SLOPED_WRONG | |
AIError::ERR_OWNED_BY_ANOTHER_COMPANY | |
AIError::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, AIStation::STATION_NEW or AIStation::STATION_JOIN_ADJACENT. |
AIError::ERR_AREA_NOT_CLEAR | |
AIError::ERR_SITE_UNSUITABLE | |
AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION | |
AIStation::ERR_STATION_TOO_MANY_STATIONS |
|
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. |
AIError::ERR_AREA_NOT_CLEAR | |
AIError::ERR_SITE_UNSUITABLE | |
AIMarine::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. |
AIError::ERR_OWNED_BY_ANOTHER_COMPANY |
|
static |
Removes a canal.
tile | Any tile of the canal. |
AIError::ERR_OWNED_BY_ANOTHER_COMPANY |
|
static |
Removes a dock.
tile | Any tile of the dock. |
AIError::ERR_OWNED_BY_ANOTHER_COMPANY |
|
static |
Removes a lock.
tile | Any tile of the lock. |
AIError::ERR_OWNED_BY_ANOTHER_COMPANY |
|
static |
Removes a water depot.
tile | Any tile of the water depot. |
AIError::ERR_OWNED_BY_ANOTHER_COMPANY |