OpenTTD AI API
20241123-master-g26ae50baf9
|
Class that handles all marine related functions. More...
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. More... | |
static bool | IsDockTile (TileIndex tile) |
Checks whether the given tile is actually a tile with a dock. More... | |
static bool | IsBuoyTile (TileIndex tile) |
Checks whether the given tile is actually a tile with a buoy. More... | |
static bool | IsLockTile (TileIndex tile) |
Checks whether the given tile is actually a tile with a lock. More... | |
static bool | IsCanalTile (TileIndex tile) |
Checks whether the given tile is actually a tile with a canal. More... | |
static bool | AreWaterTilesConnected (TileIndex tile_from, TileIndex tile_to) |
Checks whether the given tiles are directly connected, i.e. More... | |
static bool | BuildWaterDepot (TileIndex tile, TileIndex front) |
Builds a water depot on tile. More... | |
static bool | BuildDock (TileIndex tile, StationID station_id) |
Builds a dock where tile is the tile still on land. More... | |
static bool | BuildBuoy (TileIndex tile) |
Builds a buoy on tile. More... | |
static bool | BuildLock (TileIndex tile) |
Builds a lock on tile. More... | |
static bool | BuildCanal (TileIndex tile) |
Builds a canal on tile. More... | |
static bool | RemoveWaterDepot (TileIndex tile) |
Removes a water depot. More... | |
static bool | RemoveDock (TileIndex tile) |
Removes a dock. More... | |
static bool | RemoveBuoy (TileIndex tile) |
Removes a buoy. More... | |
static bool | RemoveLock (TileIndex tile) |
Removes a lock. More... | |
static bool | RemoveCanal (TileIndex tile) |
Removes a canal. More... | |
static Money | GetBuildCost (BuildType build_type) |
Get the baseprice of building a water-related object. More... | |
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 |