AIMarine Class Reference
Class that handles all marine related functions.
More...
Detailed Description
Class that handles all marine related functions.
Member Enumeration Documentation
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.
|
Member Function Documentation
static bool AIMarine::AreWaterTilesConnected |
( |
TileIndex |
tile_from, |
|
|
TileIndex |
tile_to | |
|
) |
| | [static] |
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.
- Parameters:
-
| tile_from | The source tile. |
| tile_to | The destination tile. |
- Precondition:
- AIMap::IsValidTile(tile_from).
-
AIMap::IsValidTile(tile_to).
-
'tile_from' and 'tile_to' are directly neighbouring tiles.
- Returns:
- True if and only if a ship can go from tile_from to tile_to.
static bool AIMarine::BuildBuoy |
( |
TileIndex |
tile |
) |
[static] |
Builds a buoy on tile.
- Parameters:
-
| tile | The tile where the buoy will be build. |
- Precondition:
- AIMap::IsValidTile(tile).
- Exceptions:
-
- Returns:
- Whether the buoy has been/can be build or not.
static bool AIMarine::BuildCanal |
( |
TileIndex |
tile |
) |
[static] |
Builds a canal on tile.
- Parameters:
-
| tile | The tile where the canal will be build. |
- Precondition:
- AIMap::IsValidTile(tile).
- Exceptions:
-
- Returns:
- Whether the canal has been/can be build or not.
Builds a dock where tile is the tile still on land.
- Parameters:
-
- Precondition:
- AIMap::IsValidTile(tile).
-
station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id).
- Exceptions:
-
- Returns:
- Whether the dock has been/can be build or not.
static bool AIMarine::BuildLock |
( |
TileIndex |
tile |
) |
[static] |
Builds a lock on tile.
- Parameters:
-
| tile | The tile where the lock will be build. |
- Precondition:
- AIMap::IsValidTile(tile).
- Exceptions:
-
- Returns:
- Whether the lock has been/can be build or not.
Builds a water depot on tile.
- Parameters:
-
| 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. |
- Precondition:
- AIMap::IsValidTile(tile).
-
AIMap::IsValidTile(front).
- Exceptions:
-
- Returns:
- Whether the water depot has been/can be build or not.
- Note:
- A WaterDepot is 1 tile in width, and 2 tiles in length.
static bool AIMarine::IsBuoyTile |
( |
TileIndex |
tile |
) |
[static] |
Checks whether the given tile is actually a tile with a buoy.
- Parameters:
-
- Precondition:
- AIMap::IsValidTile(tile).
- Returns:
- True if and only if the tile has a buoy.
static bool AIMarine::IsCanalTile |
( |
TileIndex |
tile |
) |
[static] |
Checks whether the given tile is actually a tile with a canal.
- Parameters:
-
- Precondition:
- AIMap::IsValidTile(tile).
- Returns:
- True if and only if the tile has a canal.
static bool AIMarine::IsDockTile |
( |
TileIndex |
tile |
) |
[static] |
Checks whether the given tile is actually a tile with a dock.
- Parameters:
-
- Precondition:
- AIMap::IsValidTile(tile).
- Returns:
- True if and only if the tile has a dock.
static bool AIMarine::IsLockTile |
( |
TileIndex |
tile |
) |
[static] |
Checks whether the given tile is actually a tile with a lock.
- Parameters:
-
- Precondition:
- AIMap::IsValidTile(tile).
- Returns:
- True if and only if the tile has a lock.
static bool AIMarine::IsWaterDepotTile |
( |
TileIndex |
tile |
) |
[static] |
Checks whether the given tile is actually a tile with a water depot.
- Parameters:
-
- Precondition:
- AIMap::IsValidTile(tile).
- Returns:
- True if and only if the tile has a water depot.
static bool AIMarine::RemoveBuoy |
( |
TileIndex |
tile |
) |
[static] |
Removes a buoy.
- Parameters:
-
| tile | Any tile of the buoy. |
- Precondition:
- AIMap::IsValidTile(tile).
- Exceptions:
-
- Returns:
- Whether the buoy has been/can be removed or not.
static bool AIMarine::RemoveCanal |
( |
TileIndex |
tile |
) |
[static] |
Removes a canal.
- Parameters:
-
| tile | Any tile of the canal. |
- Precondition:
- AIMap::IsValidTile(tile).
- Exceptions:
-
- Returns:
- Whether the canal has been/can be removed or not.
static bool AIMarine::RemoveDock |
( |
TileIndex |
tile |
) |
[static] |
Removes a dock.
- Parameters:
-
| tile | Any tile of the dock. |
- Precondition:
- AIMap::IsValidTile(tile).
- Exceptions:
-
- Returns:
- Whether the dock has been/can be removed or not.
static bool AIMarine::RemoveLock |
( |
TileIndex |
tile |
) |
[static] |
Removes a lock.
- Parameters:
-
| tile | Any tile of the lock. |
- Precondition:
- AIMap::IsValidTile(tile).
- Exceptions:
-
- Returns:
- Whether the lock has been/can be removed or not.
static bool AIMarine::RemoveWaterDepot |
( |
TileIndex |
tile |
) |
[static] |
Removes a water depot.
- Parameters:
-
| tile | Any tile of the water depot. |
- Precondition:
- AIMap::IsValidTile(tile).
- Exceptions:
-
- Returns:
- Whether the water depot has been/can be removed or not.