(svn r23633) -Add: allow most build commands from GameScript given a CompanyMode is active in that scope
This commit is contained in:
@@ -117,9 +117,9 @@ public:
|
||||
* @pre IsValidVehicle(vehicle_id).
|
||||
* @pre 'name' must have at least one character.
|
||||
* @pre 'name' must have at most 30 characters.
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptError::ERR_NAME_IS_NOT_UNIQUE
|
||||
* @return True if and only if the name was changed.
|
||||
* @api -game
|
||||
*/
|
||||
static bool SetName(VehicleID vehicle_id, const char *name);
|
||||
|
||||
@@ -308,6 +308,7 @@ public:
|
||||
* @pre The tile at depot has a depot that can build the engine and
|
||||
* is owned by you.
|
||||
* @pre ScriptEngine::IsBuildable(engine_id).
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_TOO_MANY
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_BUILD_DISABLED
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_WRONG_DEPOT
|
||||
@@ -317,7 +318,6 @@ public:
|
||||
* @note In Test Mode it means you can't assign orders yet to this vehicle,
|
||||
* as the vehicle isn't really built yet. Build it for real first before
|
||||
* assigning orders.
|
||||
* @api -game
|
||||
*/
|
||||
static VehicleID BuildVehicle(TileIndex depot, EngineID engine_id);
|
||||
|
||||
@@ -328,13 +328,13 @@ public:
|
||||
* @param share_orders Should the orders be copied or shared?
|
||||
* @pre The tile 'depot' has a depot on it, allowing 'vehicle_id'-type vehicles.
|
||||
* @pre IsValidVehicle(vehicle_id).
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_TOO_MANY
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_BUILD_DISABLED
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_WRONG_DEPOT
|
||||
* @return The VehicleID of the new vehicle, or an invalid VehicleID when
|
||||
* it failed. Check the return value using IsValidVehicle. In test-mode
|
||||
* 0 is returned if it was successful; any other value indicates failure.
|
||||
* @api -game
|
||||
*/
|
||||
static VehicleID CloneVehicle(TileIndex depot, VehicleID vehicle_id, bool share_orders);
|
||||
|
||||
@@ -349,8 +349,8 @@ public:
|
||||
* @pre dest_vehicle_id == -1 || (IsValidVehicle(dest_vehicle_id) && dest_wagon < GetNumWagons(dest_vehicle_id)).
|
||||
* @pre GetVehicleType(source_vehicle_id) == VT_RAIL.
|
||||
* @pre dest_vehicle_id == -1 || GetVehicleType(dest_vehicle_id) == VT_RAIL.
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @return Whether or not moving the wagon succeeded.
|
||||
* @api -game
|
||||
*/
|
||||
static bool MoveWagon(VehicleID source_vehicle_id, int source_wagon, int dest_vehicle_id, int dest_wagon);
|
||||
|
||||
@@ -365,8 +365,8 @@ public:
|
||||
* @pre dest_vehicle_id == -1 || (IsValidVehicle(dest_vehicle_id) && dest_wagon < GetNumWagons(dest_vehicle_id)).
|
||||
* @pre GetVehicleType(source_vehicle_id) == VT_RAIL.
|
||||
* @pre dest_vehicle_id == -1 || GetVehicleType(dest_vehicle_id) == VT_RAIL.
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @return Whether or not moving the wagons succeeded.
|
||||
* @api -game
|
||||
*/
|
||||
static bool MoveWagonChain(VehicleID source_vehicle_id, int source_wagon, int dest_vehicle_id, int dest_wagon);
|
||||
|
||||
@@ -390,11 +390,11 @@ public:
|
||||
* @pre ScriptCargo::IsValidCargo(cargo).
|
||||
* @pre You must own the vehicle.
|
||||
* @pre The vehicle must be stopped in the depot.
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_CANNOT_REFIT
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_IS_DESTROYED
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_NOT_IN_DEPOT
|
||||
* @return True if and only if the refit succeeded.
|
||||
* @api -game
|
||||
*/
|
||||
static bool RefitVehicle(VehicleID vehicle_id, CargoID cargo);
|
||||
|
||||
@@ -404,10 +404,10 @@ public:
|
||||
* @pre IsValidVehicle(vehicle_id).
|
||||
* @pre You must own the vehicle.
|
||||
* @pre The vehicle must be stopped in the depot.
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_IS_DESTROYED
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_NOT_IN_DEPOT
|
||||
* @return True if and only if the vehicle has been sold.
|
||||
* @api -game
|
||||
*/
|
||||
static bool SellVehicle(VehicleID vehicle_id);
|
||||
|
||||
@@ -419,10 +419,10 @@ public:
|
||||
* @pre wagon < GetNumWagons(vehicle_id).
|
||||
* @pre You must own the vehicle.
|
||||
* @pre The vehicle must be stopped in the depot.
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_IS_DESTROYED
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_NOT_IN_DEPOT
|
||||
* @return True if and only if the wagon has been sold.
|
||||
* @api -game
|
||||
*/
|
||||
static bool SellWagon(VehicleID vehicle_id, int wagon);
|
||||
|
||||
@@ -434,10 +434,10 @@ public:
|
||||
* @pre wagon < GetNumWagons(vehicle_id).
|
||||
* @pre You must own the vehicle.
|
||||
* @pre The vehicle must be stopped in the depot.
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_IS_DESTROYED
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_NOT_IN_DEPOT
|
||||
* @return True if and only if the wagons have been sold.
|
||||
* @api -game
|
||||
*/
|
||||
static bool SellWagonChain(VehicleID vehicle_id, int wagon);
|
||||
|
||||
@@ -446,9 +446,9 @@ public:
|
||||
* sent to a depot it continues with its normal orders instead.
|
||||
* @param vehicle_id The vehicle to send to a depot.
|
||||
* @pre IsValidVehicle(vehicle_id).
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_CANNOT_SEND_TO_DEPOT
|
||||
* @return True if the current order was changed.
|
||||
* @api -game
|
||||
*/
|
||||
static bool SendVehicleToDepot(VehicleID vehicle_id);
|
||||
|
||||
@@ -457,9 +457,9 @@ public:
|
||||
* already been sent to a depot it continues with its normal orders instead.
|
||||
* @param vehicle_id The vehicle to send to a depot for servicing.
|
||||
* @pre IsValidVehicle(vehicle_id).
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_CANNOT_SEND_TO_DEPOT
|
||||
* @return True if the current order was changed.
|
||||
* @api -game
|
||||
*/
|
||||
static bool SendVehicleToDepotForServicing(VehicleID vehicle_id);
|
||||
|
||||
@@ -467,11 +467,11 @@ public:
|
||||
* Starts or stops the given vehicle depending on the current state.
|
||||
* @param vehicle_id The vehicle to start/stop.
|
||||
* @pre IsValidVehicle(vehicle_id).
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @exception ScriptVehicle::ERR_VEHICLE_CANNOT_START_STOP
|
||||
* @exception (For aircraft only): ScriptVehicle::ERR_VEHICLE_IN_FLIGHT
|
||||
* @exception (For trains only): ScriptVehicle::ERR_VEHICLE_NO_POWER
|
||||
* @return True if and only if the vehicle has been started or stopped.
|
||||
* @api -game
|
||||
*/
|
||||
static bool StartStopVehicle(VehicleID vehicle_id);
|
||||
|
||||
@@ -480,10 +480,10 @@ public:
|
||||
* @param vehicle_id The vehicle to turn.
|
||||
* @pre IsValidVehicle(vehicle_id).
|
||||
* @pre GetVehicleType(vehicle_id) == VT_ROAD || GetVehicleType(vehicle_id) == VT_RAIL.
|
||||
* @game @pre Valid ScriptCompanyMode active in scope.
|
||||
* @return True if and only if the vehicle has started to turn.
|
||||
* @note Vehicles cannot always be reversed. For example busses and trucks need to be running
|
||||
* and not be inside a depot.
|
||||
* @api -game
|
||||
*/
|
||||
static bool ReverseVehicle(VehicleID vehicle_id);
|
||||
|
||||
|
Reference in New Issue
Block a user