(svn r23355) -Codechange: rename all AI* to Script* (Rubidium)
This commit is contained in:
@@ -17,14 +17,14 @@
|
||||
/**
|
||||
* Class that handles all marine related functions.
|
||||
*/
|
||||
class AIMarine : public AIObject {
|
||||
class ScriptMarine : public ScriptObject {
|
||||
public:
|
||||
/**
|
||||
* All marine related error messages.
|
||||
*/
|
||||
enum ErrorMessages {
|
||||
/** Base for marine related errors */
|
||||
ERR_MARINE_BASE = AIError::ERR_CAT_MARINE << AIError::ERR_CAT_BIT_SIZE,
|
||||
ERR_MARINE_BASE = ScriptError::ERR_CAT_MARINE << ScriptError::ERR_CAT_BIT_SIZE,
|
||||
|
||||
/** Infrastructure must be built on water */
|
||||
ERR_MARINE_MUST_BE_BUILT_ON_WATER, // [STR_ERROR_MUST_BE_BUILT_ON_WATER]
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
/**
|
||||
* Checks whether the given tile is actually a tile with a water depot.
|
||||
* @param tile The tile to check.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @return True if and only if the tile has a water depot.
|
||||
*/
|
||||
static bool IsWaterDepotTile(TileIndex tile);
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
/**
|
||||
* Checks whether the given tile is actually a tile with a dock.
|
||||
* @param tile The tile to check.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @return True if and only if the tile has a dock.
|
||||
*/
|
||||
static bool IsDockTile(TileIndex tile);
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
/**
|
||||
* Checks whether the given tile is actually a tile with a buoy.
|
||||
* @param tile The tile to check.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @return True if and only if the tile has a buoy.
|
||||
*/
|
||||
static bool IsBuoyTile(TileIndex tile);
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
/**
|
||||
* Checks whether the given tile is actually a tile with a lock.
|
||||
* @param tile The tile to check.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @return True if and only if the tile has a lock.
|
||||
*/
|
||||
static bool IsLockTile(TileIndex tile);
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
/**
|
||||
* Checks whether the given tile is actually a tile with a canal.
|
||||
* @param tile The tile to check.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @return True if and only if the tile has a canal.
|
||||
*/
|
||||
static bool IsCanalTile(TileIndex tile);
|
||||
@@ -85,8 +85,8 @@ public:
|
||||
* center of the second tile.
|
||||
* @param tile_from The source tile.
|
||||
* @param tile_to The destination tile.
|
||||
* @pre AIMap::IsValidTile(tile_from).
|
||||
* @pre AIMap::IsValidTile(tile_to).
|
||||
* @pre ScriptMap::IsValidTile(tile_from).
|
||||
* @pre ScriptMap::IsValidTile(tile_to).
|
||||
* @pre 'tile_from' and 'tile_to' are directly neighbouring tiles.
|
||||
* @return True if and only if a ship can go from tile_from to tile_to.
|
||||
*/
|
||||
@@ -96,11 +96,11 @@ public:
|
||||
* Builds a water depot on tile.
|
||||
* @param tile The tile where the water depot will be build.
|
||||
* @param front A tile on the same axis with 'tile' as the depot shall be oriented.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @pre AIMap::IsValidTile(front).
|
||||
* @exception AIError::ERR_AREA_NOT_CLEAR
|
||||
* @exception AIError::ERR_SITE_UNSUITABLE
|
||||
* @exception AIMarine::ERR_MARINE_MUST_BE_BUILT_ON_WATER
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @pre ScriptMap::IsValidTile(front).
|
||||
* @exception ScriptError::ERR_AREA_NOT_CLEAR
|
||||
* @exception ScriptError::ERR_SITE_UNSUITABLE
|
||||
* @exception ScriptMarine::ERR_MARINE_MUST_BE_BUILT_ON_WATER
|
||||
* @return Whether the water depot has been/can be build or not.
|
||||
* @note A WaterDepot is 1 tile in width, and 2 tiles in length.
|
||||
* @note The depot will be built towards the south from 'tile', not necessarily towards 'front'.
|
||||
@@ -110,13 +110,13 @@ public:
|
||||
/**
|
||||
* Builds a dock where tile is the tile still on land.
|
||||
* @param tile The tile still on land of the dock.
|
||||
* @param station_id The station to join, AIStation::STATION_NEW or AIStation::STATION_JOIN_ADJACENT.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @pre station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id).
|
||||
* @exception AIError::ERR_AREA_NOT_CLEAR
|
||||
* @exception AIError::ERR_SITE_UNSUITABLE
|
||||
* @exception AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
|
||||
* @exception AIStation::ERR_STATION_TOO_MANY_STATIONS
|
||||
* @param station_id The station to join, ScriptStation::STATION_NEW or ScriptStation::STATION_JOIN_ADJACENT.
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @pre station_id == ScriptStation::STATION_NEW || station_id == ScriptStation::STATION_JOIN_ADJACENT || ScriptStation::IsValidStation(station_id).
|
||||
* @exception ScriptError::ERR_AREA_NOT_CLEAR
|
||||
* @exception ScriptError::ERR_SITE_UNSUITABLE
|
||||
* @exception ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
|
||||
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS
|
||||
* @return Whether the dock has been/can be build or not.
|
||||
*/
|
||||
static bool BuildDock(TileIndex tile, StationID station_id);
|
||||
@@ -124,10 +124,10 @@ public:
|
||||
/**
|
||||
* Builds a buoy on tile.
|
||||
* @param tile The tile where the buoy will be build.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @exception AIError::ERR_AREA_NOT_CLEAR
|
||||
* @exception AIError::ERR_SITE_UNSUITABLE
|
||||
* @exception AIStation::ERR_STATION_TOO_MANY_STATIONS
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @exception ScriptError::ERR_AREA_NOT_CLEAR
|
||||
* @exception ScriptError::ERR_SITE_UNSUITABLE
|
||||
* @exception ScriptStation::ERR_STATION_TOO_MANY_STATIONS
|
||||
* @return Whether the buoy has been/can be build or not.
|
||||
*/
|
||||
static bool BuildBuoy(TileIndex tile);
|
||||
@@ -135,9 +135,9 @@ public:
|
||||
/**
|
||||
* Builds a lock on tile.
|
||||
* @param tile The tile where the lock will be build.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @exception AIError::ERR_LAND_SLOPED_WRONG
|
||||
* @exception AIError::ERR_SITE_UNSUITABLE
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @exception ScriptError::ERR_LAND_SLOPED_WRONG
|
||||
* @exception ScriptError::ERR_SITE_UNSUITABLE
|
||||
* @return Whether the lock has been/can be build or not.
|
||||
*/
|
||||
static bool BuildLock(TileIndex tile);
|
||||
@@ -145,11 +145,11 @@ public:
|
||||
/**
|
||||
* Builds a canal on tile.
|
||||
* @param tile The tile where the canal will be build.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @exception AIError::ERR_AREA_NOT_CLEAR
|
||||
* @exception AIError::ERR_LAND_SLOPED_WRONG
|
||||
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @exception AIError::ERR_ALREADY_BUILT
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @exception ScriptError::ERR_AREA_NOT_CLEAR
|
||||
* @exception ScriptError::ERR_LAND_SLOPED_WRONG
|
||||
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @exception ScriptError::ERR_ALREADY_BUILT
|
||||
* @return Whether the canal has been/can be build or not.
|
||||
*/
|
||||
static bool BuildCanal(TileIndex tile);
|
||||
@@ -157,8 +157,8 @@ public:
|
||||
/**
|
||||
* Removes a water depot.
|
||||
* @param tile Any tile of the water depot.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @return Whether the water depot has been/can be removed or not.
|
||||
*/
|
||||
static bool RemoveWaterDepot(TileIndex tile);
|
||||
@@ -166,8 +166,8 @@ public:
|
||||
/**
|
||||
* Removes a dock.
|
||||
* @param tile Any tile of the dock.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @return Whether the dock has been/can be removed or not.
|
||||
*/
|
||||
static bool RemoveDock(TileIndex tile);
|
||||
@@ -175,8 +175,8 @@ public:
|
||||
/**
|
||||
* Removes a buoy.
|
||||
* @param tile Any tile of the buoy.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @return Whether the buoy has been/can be removed or not.
|
||||
*/
|
||||
static bool RemoveBuoy(TileIndex tile);
|
||||
@@ -184,8 +184,8 @@ public:
|
||||
/**
|
||||
* Removes a lock.
|
||||
* @param tile Any tile of the lock.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @return Whether the lock has been/can be removed or not.
|
||||
*/
|
||||
static bool RemoveLock(TileIndex tile);
|
||||
@@ -193,8 +193,8 @@ public:
|
||||
/**
|
||||
* Removes a canal.
|
||||
* @param tile Any tile of the canal.
|
||||
* @pre AIMap::IsValidTile(tile).
|
||||
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @pre ScriptMap::IsValidTile(tile).
|
||||
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
|
||||
* @return Whether the canal has been/can be removed or not.
|
||||
*/
|
||||
static bool RemoveCanal(TileIndex tile);
|
||||
|
Reference in New Issue
Block a user