(svn r23355) -Codechange: rename all AI* to Script* (Rubidium)

This commit is contained in:
truebrain
2011-11-29 23:15:35 +00:00
parent eab012ec8b
commit af1b3cc070
175 changed files with 4048 additions and 4034 deletions

View File

@@ -17,7 +17,7 @@
/**
* Class that handles all tunnel related functions.
*/
class AITunnel : public AIObject {
class ScriptTunnel : public ScriptObject {
public:
/**
* All tunnel related errors.
@@ -25,7 +25,7 @@ public:
enum ErrorMessages {
/** Base for bridge related errors */
ERR_TUNNEL_BASE = AIError::ERR_CAT_TUNNEL << AIError::ERR_CAT_BIT_SIZE,
ERR_TUNNEL_BASE = ScriptError::ERR_CAT_TUNNEL << ScriptError::ERR_CAT_BIT_SIZE,
/** Can't build tunnels on water */
ERR_TUNNEL_CANNOT_BUILD_ON_WATER, // [STR_ERROR_CAN_T_BUILD_ON_WATER]
@@ -43,7 +43,7 @@ public:
/**
* Check whether the tile is an entrance to a tunnel.
* @param tile The tile to check.
* @pre AIMap::IsValidTile(tile).
* @pre ScriptMap::IsValidTile(tile).
* @return True if and only if the tile is the beginning or end of a tunnel.
*/
static bool IsTunnelTile(TileIndex tile);
@@ -51,13 +51,13 @@ public:
/**
* Get the tile that exits on the other end of a (would be) tunnel starting
* at tile. If there is no 'simple' inclined slope at the start tile,
* this function will return AIMap::TILE_INVALID.
* this function will return ScriptMap::TILE_INVALID.
* @param tile The tile that is an entrance to a tunnel or the tile where you may want to build a tunnel.
* @pre AIMap::IsValidTile(tile).
* @pre ScriptMap::IsValidTile(tile).
* @return The TileIndex that is the other end of the (would be) tunnel, or
* AIMap::TILE_INVALID if no other end was found (can't build tunnel).
* ScriptMap::TILE_INVALID if no other end was found (can't build tunnel).
* @note Even if this function returns a valid tile, that is no guarantee
* that building a tunnel will succeed. Use BuildTunnel in AITestMode to
* that building a tunnel will succeed. Use BuildTunnel in ScriptTestMode to
* check whether a tunnel can actually be build.
*/
static TileIndex GetOtherTunnelEnd(TileIndex tile);
@@ -77,32 +77,32 @@ public:
/**
* Builds a tunnel starting at start. The direction of the tunnel depends
* on the slope of the start tile. Tunnels can be created for either
* rails or roads; use the appropriate AIVehicle::VehicleType.
* rails or roads; use the appropriate ScriptVehicle::VehicleType.
* As an extra for road, this functions builds two half-pieces of road on
* each end of the tunnel, making it easier for you to connect it to your
* network.
* @param start Where to start the tunnel.
* @param vehicle_type The vehicle-type of tunnel to build.
* @pre AIMap::IsValidTile(start).
* @pre vehicle_type == AIVehicle::VT_ROAD || (vehicle_type == AIVehicle::VT_RAIL &&
* AIRail::IsRailTypeAvailable(AIRail::GetCurrentRailType())).
* @exception AIError::ERR_AREA_NOT_CLEAR
* @exception AITunnel::ERR_TUNNEL_CANNOT_BUILD_ON_WATER
* @exception AITunnel::ERR_TUNNEL_START_SITE_UNSUITABLE
* @exception AITunnel::ERR_TUNNEL_ANOTHER_TUNNEL_IN_THE_WAY
* @exception AITunnel::ERR_TUNNEL_END_SITE_UNSUITABLE
* @pre ScriptMap::IsValidTile(start).
* @pre vehicle_type == ScriptVehicle::VT_ROAD || (vehicle_type == ScriptVehicle::VT_RAIL &&
* ScriptRail::IsRailTypeAvailable(ScriptRail::GetCurrentRailType())).
* @exception ScriptError::ERR_AREA_NOT_CLEAR
* @exception ScriptTunnel::ERR_TUNNEL_CANNOT_BUILD_ON_WATER
* @exception ScriptTunnel::ERR_TUNNEL_START_SITE_UNSUITABLE
* @exception ScriptTunnel::ERR_TUNNEL_ANOTHER_TUNNEL_IN_THE_WAY
* @exception ScriptTunnel::ERR_TUNNEL_END_SITE_UNSUITABLE
* @return Whether the tunnel has been/can be build or not.
* @note The slope of a tile can be determined by AITile::GetSlope(TileIndex).
* @note The slope of a tile can be determined by ScriptTile::GetSlope(TileIndex).
* @note No matter if the road pieces were build or not, if building the
* tunnel succeeded, this function returns true.
*/
static bool BuildTunnel(AIVehicle::VehicleType vehicle_type, TileIndex start);
static bool BuildTunnel(ScriptVehicle::VehicleType vehicle_type, TileIndex start);
/**
* Remove the tunnel whose entrance is located at tile.
* @param tile The tile that is an entrance to a tunnel.
* @pre AIMap::IsValidTile(tile) && IsTunnelTile(tile).
* @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
* @pre ScriptMap::IsValidTile(tile) && IsTunnelTile(tile).
* @exception ScriptError::ERR_OWNED_BY_ANOTHER_COMPANY
* @return Whether the tunnel has been/can be removed or not.
*/
static bool RemoveTunnel(TileIndex tile);