src/ai/api/ai_vehicle.hpp
author rubidium
Mon, 07 Apr 2008 18:41:49 +0000
branchnoai
changeset 10090 d6a6cac2fb25
parent 9874 4ecef0dadf01
child 10096 780921b39016
permissions -rw-r--r--
(svn r12614) [NoAI] -Add: support for GetLastError in AISign. Patch by Morloth.
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
     1
/* $Id$ */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
     2
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
     3
/** @file ai_vehicle.hpp Everything to query and build vehicles. */
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
     4
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
     5
#ifndef AI_VEHICLE_HPP
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
     6
#define AI_VEHICLE_HPP
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
     7
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
     8
#include "ai_object.hpp"
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
     9
#include "ai_error.hpp"
9837
c9ec4f82e0d0 (svn r12503) [NoAI] -Sync: with trunk r12461:12501.
rubidium
parents: 9829
diff changeset
    10
#include "../../engine_type.h"
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    11
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    12
/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    13
 * Class that handles all vehicle related functions.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    14
 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    15
class AIVehicle : public AIObject {
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    16
public:
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
    17
	static const char *GetClassName() { return "AIVehicle"; }
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
    18
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    19
	enum ErrorMessages {
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    20
		/** Base for vehicle related errors */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    21
		ERR_VEHICLE_BASE = AIError::ERR_CAT_VEHICLE << AIError::ERR_CAT_BIT_SIZE,
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    22
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    23
		/** Too many vehicles in the game, can't build any more. */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    24
		ERR_VEHICLE_TOO_MANY,                   // [STR_00E1_TOO_MANY_VEHICLES_IN_GAME]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    25
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    26
		/** Vehicle is not available */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    27
		ERR_VEHICLE_NOT_AVAILABLE,              // [STR_AIRCRAFT_NOT_AVAILABLE, STR_ROAD_VEHICLE_NOT_AVAILABLE, STR_SHIP_NOT_AVAILABLE, STR_RAIL_VEHICLE_NOT_AVAILABLE]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    28
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    29
		/** Vehicle can't be build due to game settigns */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    30
		ERR_VEHICLE_BUILD_DISABLED,             // [STR_A008_CAN_T_BUILD_AIRCRAFT, STR_980D_CAN_T_BUILD_SHIP, STR_9009_CAN_T_BUILD_ROAD_VEHICLE, STR_882B_CAN_T_BUILD_RAILROAD_VEHICLE]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    31
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    32
		/** Vehicle can't be build in the selected depot */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    33
		ERR_VEHICLE_WRONG_DEPOT,                // [STR_DEPOT_WRONG_DEPOT_TYPE]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    34
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    35
		/** Vehicle can't return to the depot */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    36
		ERR_VEHICLE_CANNOT_SEND_TO_DEPOT,       // [STR_8830_CAN_T_SEND_TRAIN_TO_DEPOT, STR_9018_CAN_T_SEND_VEHICLE_TO_DEPOT, STR_9819_CAN_T_SEND_SHIP_TO_DEPOT, STR_A012_CAN_T_SEND_AIRCRAFT_TO]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    37
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    38
		/** Vehicle can't start / stop */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    39
		ERR_VEHICLE_CANNOT_START_STOP,          // [STR_883B_CAN_T_STOP_START_TRAIN, STR_9015_CAN_T_STOP_START_ROAD_VEHICLE, STR_9818_CAN_T_STOP_START_SHIP, STR_A016_CAN_T_STOP_START_AIRCRAFT]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    40
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    41
		/** Vehicle can't turn */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    42
		ERR_VEHICLE_CANNOT_TURN,                // [STR_8869_CAN_T_REVERSE_DIRECTION, STR_9033_CAN_T_MAKE_VEHICLE_TURN]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    43
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    44
		/** Vehicle can't be refit */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    45
		ERR_VEHICLE_CANNOT_REFIT,               // [STR_RAIL_CAN_T_REFIT_VEHICLE, STR_REFIT_ROAD_VEHICLE_CAN_T, STR_9841_CAN_T_REFIT_SHIP, STR_A042_CAN_T_REFIT_AIRCRAFT]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    46
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    47
		/** Vehicle is destroyed */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    48
		ERR_VEHICLE_IS_DESTROYED,               // [STR_CAN_T_REFIT_DESTROYED_VEHICLE, STR_CAN_T_SELL_DESTROYED_VEHICLE]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    49
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    50
		/** Vehicle is not in a depot */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    51
		ERR_VEHICLE_NOT_IN_DEPOT,               // [STR_A01B_AIRCRAFT_MUST_BE_STOPPED, STR_9013_MUST_BE_STOPPED_INSIDE, STR_TRAIN_MUST_BE_STOPPED, STR_980B_SHIP_MUST_BE_STOPPED_IN]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    52
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    53
		/** Vehicle is flying */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    54
		ERR_VEHICLE_IN_FLIGHT,                  // [STR_A017_AIRCRAFT_IS_IN_FLIGHT]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    55
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    56
		/** Vehicle is without power */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    57
		ERR_VEHCILE_NO_POWER,                   // [STR_TRAIN_START_NO_CATENARY]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    58
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    59
	};
9685
d988aad9fc52 (svn r10634) [NoAI] -Documentation: of course I forgot to document the VehicleType enum
truelight
parents: 9684
diff changeset
    60
	/**
d988aad9fc52 (svn r10634) [NoAI] -Documentation: of course I forgot to document the VehicleType enum
truelight
parents: 9684
diff changeset
    61
	 * The type of a vehicle available in the game. Trams for example are
d988aad9fc52 (svn r10634) [NoAI] -Documentation: of course I forgot to document the VehicleType enum
truelight
parents: 9684
diff changeset
    62
	 *  road vehicles, as maglev is a rail vehicle.
d988aad9fc52 (svn r10634) [NoAI] -Documentation: of course I forgot to document the VehicleType enum
truelight
parents: 9684
diff changeset
    63
	 */
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    64
	enum VehicleType {
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    65
		/* Order IS important, as it now matches the internal state of the game for vehicle type */
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    66
		VEHICLE_RAIL,           //!< Rail type vehicle.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    67
		VEHICLE_ROAD,           //!< Road type vehicle (bus / truck).
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    68
		VEHICLE_WATER,          //!< Water type vehicle.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    69
		VEHICLE_AIR,            //!< Air type vehicle.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    70
		VEHICLE_INVALID = 0xFF, //!< Invalid vehicle type.
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    71
	};
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    72
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    73
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    74
	 * Checks whether the given vehicle is valid and owned by you.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    75
	 * @param vehicle_id The vehicle to check.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    76
	 * @return True if and only if the vehicle is valid.
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    77
	 */
9497
f6678533ccba (svn r9369) [NoAI] -Codechange: make some IsValidXXX() function static, so they can be used by the other classes without the need for an instance.
rubidium
parents: 9491
diff changeset
    78
	static bool IsValidVehicle(VehicleID vehicle_id);
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    79
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    80
	/**
9699
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
    81
	 * Set the name of a vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    82
	 * @param vehicle_id The vehicle to set the name for.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    83
	 * @param name The name for the vehicle.
9699
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
    84
	 * @pre IsValidVehicle(vehicle_id).
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
    85
	 * @pre Name has to be unique.
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
    86
	 * @pre You have to own the vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    87
	 * @return True if and only if the name was changed.
9699
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
    88
	 */
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    89
	static bool SetName(VehicleID vehicle_id, const char *name);
9699
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
    90
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
    91
	/**
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
    92
	 * Get the name of a vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    93
	 * @param vehicle_id The vehicle to get the name of.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
    94
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
    95
	 * @return The name the vehicle has.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
    96
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
    97
	static char *GetName(VehicleID vehicle_id);
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
    98
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
    99
	/**
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   100
	 * Get the current location of a vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   101
	 * @param vehicle_id The vehicle to get the location of.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   102
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   103
	 * @return The tile the vehicle is currently on.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   104
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   105
	static TileIndex GetLocation(VehicleID vehicle_id);
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   106
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   107
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   108
	 * Get the engine-type of a vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   109
	 * @param vehicle_id The vehicle to get the engine-type of.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   110
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   111
	 * @return The engine type the vehicle has.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   112
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   113
	static EngineID GetEngineType(VehicleID vehicle_id);
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   114
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   115
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   116
	 * Get the unitnumber of a vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   117
	 * @param vehicle_id The vehicle to get the unitnumber of.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   118
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   119
	 * @return The unitnumber the vehicle has.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   120
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   121
	static int32 GetUnitNumber(VehicleID vehicle_id);
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   122
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   123
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   124
	 * Get the current age of a vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   125
	 * @param vehicle_id The vehicle to get the age of.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   126
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   127
	 * @return The current age the vehicle has.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   128
	 * @note The age is in days.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   129
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   130
	static int32 GetAge(VehicleID vehicle_id);
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   131
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   132
	/**
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   133
	 * Get the maximum age of a vehicle.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   134
	 * @param vehicle_id The vehicle to get the age of.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   135
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   136
	 * @return The maximum age the vehicle has.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   137
	 * @note The age is in days.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   138
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   139
	static int32 GetMaxAge(VehicleID vehicle_id);
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   140
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   141
	/**
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   142
	 * Get the age a vehicle has left (maximum - current).
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   143
	 * @param vehicle_id The vehicle to get the age of.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   144
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   145
	 * @return The age the vehicle has left.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   146
	 * @note The age is in days.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   147
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   148
	static int32 GetAgeLeft(VehicleID vehicle_id);
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   149
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   150
	/**
9733
49e424cd4edd (svn r12212) [NoAI] -Add: added AIEngine::GetMaxAge, AIEngine::GetRunningCost and AIVehicle::GetRunningCost (Morloth)
truebrain
parents: 9723
diff changeset
   151
	 * Get the running cost of this vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   152
	 * @param vehicle_id The vehicle to get the age of.
9733
49e424cd4edd (svn r12212) [NoAI] -Add: added AIEngine::GetMaxAge, AIEngine::GetRunningCost and AIVehicle::GetRunningCost (Morloth)
truebrain
parents: 9723
diff changeset
   153
	 * @pre IsValidVehicle(vehicle_id).
49e424cd4edd (svn r12212) [NoAI] -Add: added AIEngine::GetMaxAge, AIEngine::GetRunningCost and AIVehicle::GetRunningCost (Morloth)
truebrain
parents: 9723
diff changeset
   154
	 * @return The running cost of the vehicle per year.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   155
	 * @note Cost is per year; divide by 364 to get per day.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   156
	 * @note This is not equal to AIEngine::GetRunningCost for Trains, because
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   157
	 *   wagons and second engines can add up in the calculation too.
9733
49e424cd4edd (svn r12212) [NoAI] -Add: added AIEngine::GetMaxAge, AIEngine::GetRunningCost and AIVehicle::GetRunningCost (Morloth)
truebrain
parents: 9723
diff changeset
   158
	 */
49e424cd4edd (svn r12212) [NoAI] -Add: added AIEngine::GetMaxAge, AIEngine::GetRunningCost and AIVehicle::GetRunningCost (Morloth)
truebrain
parents: 9723
diff changeset
   159
	static Money GetRunningCost(VehicleID vehicle_id);
49e424cd4edd (svn r12212) [NoAI] -Add: added AIEngine::GetMaxAge, AIEngine::GetRunningCost and AIVehicle::GetRunningCost (Morloth)
truebrain
parents: 9723
diff changeset
   160
49e424cd4edd (svn r12212) [NoAI] -Add: added AIEngine::GetMaxAge, AIEngine::GetRunningCost and AIVehicle::GetRunningCost (Morloth)
truebrain
parents: 9723
diff changeset
   161
	/**
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   162
	 * Get the current profit of a vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   163
	 * @param vehicle_id The vehicle to get the profit of.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   164
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   165
	 * @return The current profit the vehicle has.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   166
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   167
	static int32 GetProfitThisYear(VehicleID vehicle_id);
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   168
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   169
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   170
	 * Get the profit of last year of a vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   171
	 * @param vehicle_id The vehicle to get the profit of.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   172
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   173
	 * @return The profit the vehicle had last year.
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   174
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   175
	static int32 GetProfitLastYear(VehicleID vehicle_id);
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
   176
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   177
	/**
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   178
	 * Get the type of vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   179
	 * @param vehicle_id The vehicle to get the type of.
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   180
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   181
	 * @return The vehicle type.
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   182
	 */
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   183
	static AIVehicle::VehicleType GetVehicleType(VehicleID vehicle_id);
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   184
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   185
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   186
	 * Check if a vehicle is in a depot.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   187
	 * @param vehicle_id The vehicle to check.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   188
	 * @pre IsValidVehicle(vehicle_id).
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   189
	 * @return True if and only if the vehicle is in a depot.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   190
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   191
	static bool IsInDepot(VehicleID vehicle_id);
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   192
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   193
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   194
	 * Check if a vehicle is in a depot and stopped.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   195
	 * @param vehicle_id The vehicle to check.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   196
	 * @pre IsValidVehicle(vehicle_id).
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   197
	 * @return True if and only if the vehicle is in a depot and stopped.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   198
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   199
	static bool IsStoppedInDepot(VehicleID vehicle_id);
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   200
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   201
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   202
	 * Builds a vehicle with the given engine at the given depot.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   203
	 * @param depot The depot where the vehicle will be build.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   204
	 * @param engine_id The engine to use for this vehicle.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   205
	 * @pre The tile at depot has a depot that can build the engine and
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   206
	 *   is owned by you.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   207
	 * @pre IsValidEngine(engine_id).
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   208
	 * @exception AIVehicle::ERR_VEHICLE_TOO_MANY
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   209
	 * @exception AIVehicle::ERR_VEHICLE_BUILD_DISABLED
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   210
	 * @exception AIVehicle::ERR_VEHICLE_WRONG_DEPOT
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   211
	 * @return The VehicleID of the new vehicle, or an invalid VehicleID when
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   212
	 *   it failed. Check the return value using IsValidVehicle. In test-mode
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   213
	 *   0 is returned if it was successful; any other value indicates failure.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   214
	 * @note In Test Mode it means you can't assign orders yet to this vehicle,
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   215
	 *   as the vehicle isn't really built yet. Build it for real first before
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   216
	 *   assigning orders.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   217
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   218
	static VehicleID BuildVehicle(TileIndex depot, EngineID engine_id);
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   219
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   220
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   221
	 * Clones a vehicle at the given depot, copying or cloning it's orders.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   222
	 * @param depot The depot where the vehicle will be build.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   223
	 * @param vehicle_id The vehicle to use as example for the new vehicle.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   224
	 * @param share_orders Should the orders be copied or shared?
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   225
	 * @pre The tile 'depot' has a depot on it, allowing 'vehicle_id'-type vehicles.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   226
	 * @pre IsValidVehicle(vehicle_id).
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   227
	 * @exception AIVehicle::ERR_VEHICLE_TOO_MANY
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   228
	 * @exception AIVehicle::ERR_VEHICLE_BUILD_DISABLED
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   229
	 * @exception AIVehicle::ERR_VEHICLE_WRONG_DEPOT
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   230
	 * @return The VehicleID of the new vehicle, or an invalid VehicleID when
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   231
	 *   it failed. Check the return value using IsValidVehicle. In test-mode
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   232
	 *   0 is returned if it was successful; any other value indicates failure.
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   233
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   234
	static VehicleID CloneVehicle(TileIndex depot, VehicleID vehicle_id, bool share_orders);
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   235
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   236
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   237
	 * Refits a vehicle to the given cargo type
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   238
	 * @param vehicle_id The vehicle to refit
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   239
	 * @param cargo The cargo to refit to.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   240
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   241
	 * @pre AICargo::IsValidCargo(cargo).
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   242
	 * @pre You must own the vehicle.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   243
	 * @pre The vehicle must be stopped in the depot.
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   244
	 * @exception AIVehicle::ERR_VEHICLE_CANNOT_REFIT
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   245
	 * @exception AIVehicle::ERR_VEHICLE_IS_DESTROYED
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   246
	 * @exception AIVehicle::ERR_VEHICLE_NOT_IN_DEPOT
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   247
	 * @return True if and only if the refit succeeded.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   248
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   249
	static bool RefitVehicle(VehicleID vehicle_id, CargoID cargo);
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   250
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   251
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   252
	 * Sells the given vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   253
	 * @param vehicle_id The vehicle to sell.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   254
	 * @pre IsValidVehicle(vehicle_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   255
	 * @pre You must own the vehicle.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   256
	 * @pre The vehicle must be stopped in the depot.
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   257
	 * @exception AIVehicle::ERR_VEHICLE_IS_DESTROYED
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   258
	 * @exception AIVehicle::ERR_VEHICLE_NOT_IN_DEPOT
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   259
	 * @return True if and only if the vehicle has been sold.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   260
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   261
	static bool SellVehicle(VehicleID vehicle_id);
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   262
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   263
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   264
	 * Sends the given vehicle to a depot.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   265
	 * @param vehicle_id The vehicle to send to a depot.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   266
	 * @pre IsValidVehicle(vehicle_id).
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   267
	 * @exception AIVehicle::ERR_VEHICLE_CANNOT_SEND_TO_DEPOT
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   268
	 * @return True if and only if the vehicle has been sent to a depot.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   269
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   270
	static bool SendVehicleToDepot(VehicleID vehicle_id);
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   271
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   272
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   273
	 * Starts or stops the given vehicle depending on the current state.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   274
	 * @param vehicle_id The vehicle to start/stop.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   275
	 * @pre IsValidVehicle(vehicle_id).
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   276
	 * @exception AIVehicle::ERR_VEHICLE_CANNOT_START_STOP
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   277
	 * @exception (For aircraft only): AIVehicle::ERR_VEHICLE_IN_FLIGHT
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   278
	 * @exception (For trains only): AIVehicle::ERR_VEHICLE_NO_POWER
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   279
	 * @return True if and only if the vehicle has been started or stopped.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   280
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   281
	static bool StartStopVehicle(VehicleID vehicle_id);
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   282
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   283
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   284
	 * Skips the current order of the given vehicle.
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   285
	 * @param vehicle_id The vehicle to skip the order for.
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   286
	 * @param order_id The selected order to which we want to skip.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   287
	 * @pre IsValidVehicleOrder(vehicle_id, order_id).
9838
0839682a601b (svn r12504) [NoAI] -Documentation: the last few files which now are consistent in their comments (anyway, so I hope :))
truebrain
parents: 9837
diff changeset
   288
	 * @return True if and only if the order has been skipped.
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   289
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   290
	static bool SkipToVehicleOrder(VehicleID vehicle_id, uint32 order_id);
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   291
};
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   292
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   293
#endif /* AI_VEHICLE_HPP */