Class that handles all marine related functions. More...
#include <script_marine.hpp>
Public Types | |
| enum | ErrorMessages { ERR_MARINE_BASE = ScriptError::ERR_CAT_MARINE << ScriptError::ERR_CAT_BIT_SIZE, ERR_MARINE_MUST_BE_BUILT_ON_WATER } |
All marine related error messages. More... | |
| enum | BuildType { BT_DOCK, BT_DEPOT, BT_BUOY } |
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.
ai game
Definition at line 21 of file script_marine.hpp.
Types of water-related objects in the game.
Definition at line 37 of file script_marine.hpp.
All marine related error messages.
| ERR_MARINE_BASE |
Base for marine related errors. |
| ERR_MARINE_MUST_BE_BUILT_ON_WATER |
Infrastructure must be built on water. |
Definition at line 26 of file script_marine.hpp.
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. |
Definition at line 54 of file script_marine.cpp.
References DiagdirBetweenTiles(), DiagdirReachesTracks(), DistanceManhattan(), GetTileTrackStatus(), IsValidTile(), ReverseDiagDir(), TRACK_BIT_NONE, and TrackStatusToTrackBits().
| bool ScriptMarine::BuildBuoy | ( | TileIndex | tile | ) | [static] |
Builds a buoy on tile.
| tile | The tile where the buoy will be build. |
| ScriptError::ERR_AREA_NOT_CLEAR | ||
| ScriptError::ERR_SITE_UNSUITABLE | ||
| ScriptStation::ERR_STATION_TOO_MANY_STATIONS |
Definition at line 95 of file script_marine.cpp.
References CMD_BUILD_BUOY, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), IsValidTile(), and OWNER_DEITY.
| bool ScriptMarine::BuildCanal | ( | TileIndex | tile | ) | [static] |
Builds a canal on tile.
| tile | The tile where the canal will be build. |
| ScriptError::ERR_AREA_NOT_CLEAR | ||
| ScriptError::ERR_LAND_SLOPED_WRONG | ||
| ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY | ||
| ScriptError::ERR_ALREADY_BUILT |
Definition at line 111 of file script_marine.cpp.
References CMD_BUILD_CANAL, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), IsValidTile(), OWNER_DEITY, and WATER_CLASS_CANAL.
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, ScriptStation::STATION_NEW or ScriptStation::STATION_JOIN_ADJACENT. |
| ScriptError::ERR_AREA_NOT_CLEAR | ||
| ScriptError::ERR_SITE_UNSUITABLE | ||
| ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION | ||
| ScriptStation::ERR_STATION_TOO_MANY_STATIONS |
Definition at line 84 of file script_marine.cpp.
References CMD_BUILD_DOCK, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), ScriptStation::IsValidStation(), IsValidTile(), OWNER_DEITY, ScriptBaseStation::STATION_JOIN_ADJACENT, and ScriptBaseStation::STATION_NEW.
| bool ScriptMarine::BuildLock | ( | TileIndex | tile | ) | [static] |
Builds a lock on tile.
| tile | The tile where the lock will be build. |
Definition at line 103 of file script_marine.cpp.
References CMD_BUILD_LOCK, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), IsValidTile(), and OWNER_DEITY.
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. |
| ScriptError::ERR_AREA_NOT_CLEAR | ||
| ScriptError::ERR_SITE_UNSUITABLE | ||
| ScriptMarine::ERR_MARINE_MUST_BE_BUILT_ON_WATER |
Definition at line 74 of file script_marine.cpp.
References CMD_BUILD_SHIP_DEPOT, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), IsValidTile(), OWNER_DEITY, TileX(), and TileY().
Get the baseprice of building a water-related object.
| build_type | the type of object to build |
Definition at line 164 of file script_marine.cpp.
References BT_BUOY, BT_DEPOT, BT_DOCK, and GetPrice().
| bool ScriptMarine::IsBuoyTile | ( | TileIndex | tile | ) | [static] |
Checks whether the given tile is actually a tile with a buoy.
| tile | The tile to check. |
Definition at line 33 of file script_marine.cpp.
References IsBuoy(), IsTileType(), IsValidTile(), and MP_STATION.
Referenced by ScriptWaypoint::GetWaypointID(), and RemoveBuoy().
| bool ScriptMarine::IsCanalTile | ( | TileIndex | tile | ) | [static] |
Checks whether the given tile is actually a tile with a canal.
| tile | The tile to check. |
Definition at line 47 of file script_marine.cpp.
References IsCanal(), IsTileType(), IsValidTile(), and MP_WATER.
Referenced by RemoveCanal().
| bool ScriptMarine::IsDockTile | ( | TileIndex | tile | ) | [static] |
Checks whether the given tile is actually a tile with a dock.
| tile | The tile to check. |
Definition at line 26 of file script_marine.cpp.
References IsDock(), IsTileType(), IsValidTile(), and MP_STATION.
Referenced by RemoveDock().
| bool ScriptMarine::IsLockTile | ( | TileIndex | tile | ) | [static] |
Checks whether the given tile is actually a tile with a lock.
| tile | The tile to check. |
Definition at line 40 of file script_marine.cpp.
References GetWaterTileType(), IsTileType(), IsValidTile(), MP_WATER, and WATER_TILE_LOCK.
Referenced by RemoveLock().
| bool ScriptMarine::IsWaterDepotTile | ( | TileIndex | tile | ) | [static] |
Checks whether the given tile is actually a tile with a water depot.
| tile | The tile to check. |
Definition at line 19 of file script_marine.cpp.
References GetWaterTileType(), IsTileType(), IsValidTile(), MP_WATER, and WATER_TILE_DEPOT.
Referenced by RemoveWaterDepot().
| bool ScriptMarine::RemoveBuoy | ( | TileIndex | tile | ) | [static] |
Removes a buoy.
| tile | Any tile of the buoy. |
| ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY |
Definition at line 137 of file script_marine.cpp.
References CMD_LANDSCAPE_CLEAR, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), IsBuoyTile(), IsValidTile(), and OWNER_DEITY.
| bool ScriptMarine::RemoveCanal | ( | TileIndex | tile | ) | [static] |
Removes a canal.
| tile | Any tile of the canal. |
| ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY |
Definition at line 155 of file script_marine.cpp.
References CMD_LANDSCAPE_CLEAR, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), IsCanalTile(), IsValidTile(), and OWNER_DEITY.
| bool ScriptMarine::RemoveDock | ( | TileIndex | tile | ) | [static] |
Removes a dock.
| tile | Any tile of the dock. |
| ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY |
Definition at line 128 of file script_marine.cpp.
References CMD_LANDSCAPE_CLEAR, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), IsDockTile(), IsValidTile(), and OWNER_DEITY.
| bool ScriptMarine::RemoveLock | ( | TileIndex | tile | ) | [static] |
Removes a lock.
| tile | Any tile of the lock. |
| ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY |
Definition at line 146 of file script_marine.cpp.
References CMD_LANDSCAPE_CLEAR, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), IsLockTile(), IsValidTile(), and OWNER_DEITY.
| bool ScriptMarine::RemoveWaterDepot | ( | TileIndex | tile | ) | [static] |
Removes a water depot.
| tile | Any tile of the water depot. |
| ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY |
Definition at line 119 of file script_marine.cpp.
References CMD_LANDSCAPE_CLEAR, ScriptObject::DoCommand(), EnforcePrecondition, ScriptObject::GetCompany(), IsValidTile(), IsWaterDepotTile(), and OWNER_DEITY.
1.7.1