src/ai/api/ai_vehicle.hpp
author truebrain
Fri, 18 Jul 2008 10:15:16 +0000
branchnoai
changeset 11168 3842648184cd
parent 11057 188a9ca6d8de
permissions -rw-r--r--
(svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
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"
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10339
diff changeset
    10
#include "ai_road.hpp"
11029
776c7cc8bda5 (svn r13585) [NoAI] -Add: possibility to get information/perform order changes based on the current order of a vehicle.
rubidium
parents: 11000
diff changeset
    11
#include "ai_order.hpp"
9491
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
/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    14
 * 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
    15
 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    16
class AIVehicle : public AIObject {
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    17
public:
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
    18
	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
    19
10096
780921b39016 (svn r12627) [NoAI] -Fix: last few commits missed some comments around enums
truebrain
parents: 9874
diff changeset
    20
	/**
780921b39016 (svn r12627) [NoAI] -Fix: last few commits missed some comments around enums
truebrain
parents: 9874
diff changeset
    21
	 * All vehicle related error messages.
780921b39016 (svn r12627) [NoAI] -Fix: last few commits missed some comments around enums
truebrain
parents: 9874
diff changeset
    22
	 */
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    23
	enum ErrorMessages {
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    24
		/** Base for vehicle related errors */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    25
		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
    26
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    27
		/** 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
    28
		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
    29
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    30
		/** Vehicle is not available */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    31
		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
    32
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    33
		/** Vehicle can't be build due to game settigns */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    34
		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
    35
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    36
		/** Vehicle can't be build in the selected depot */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    37
		ERR_VEHICLE_WRONG_DEPOT,                // [STR_DEPOT_WRONG_DEPOT_TYPE]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    38
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    39
		/** Vehicle can't return to the depot */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    40
		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
    41
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    42
		/** Vehicle can't start / stop */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    43
		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
    44
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    45
		/** Vehicle can't turn */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    46
		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
    47
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    48
		/** Vehicle can't be refit */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    49
		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
    50
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    51
		/** Vehicle is destroyed */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    52
		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
    53
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    54
		/** Vehicle is not in a depot */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    55
		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
    56
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    57
		/** Vehicle is flying */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    58
		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
    59
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    60
		/** Vehicle is without power */
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    61
		ERR_VEHCILE_NO_POWER,                   // [STR_TRAIN_START_NO_CATENARY]
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    62
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
    63
	};
10999
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    64
9685
d988aad9fc52 (svn r10634) [NoAI] -Documentation: of course I forgot to document the VehicleType enum
truelight
parents: 9684
diff changeset
    65
	/**
d988aad9fc52 (svn r10634) [NoAI] -Documentation: of course I forgot to document the VehicleType enum
truelight
parents: 9684
diff changeset
    66
	 * 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
    67
	 *  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
    68
	 */
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    69
	enum VehicleType {
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    70
		/* 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
    71
		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
    72
		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
    73
		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
    74
		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
    75
		VEHICLE_INVALID = 0xFF, //!< Invalid vehicle type.
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    76
	};
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    77
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    78
	/**
10999
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    79
	 * The different states a vehicle can be in.
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    80
	 */
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    81
	enum VehicleState {
11000
51305152af09 (svn r13554) [NoAI] -Fix (r13553): do compile the right directory before commiting... otherwise you'll end up with committing compile errors :(
rubidium
parents: 10999
diff changeset
    82
		VS_RUNNING,        //!< The vehicle is currently running.
10999
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    83
		VS_STOPPED,        //!< The vehicle is stopped manually.
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    84
		VS_IN_DEPOT,       //!< The vehicle is stopped in the depot.
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    85
		VS_AT_STATION,     //!< The vehicle is stopped at a station and is currently loading or unloading.
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    86
		VS_BROKEN,         //!< The vehicle has broken down and will start running again in a while.
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    87
		VS_CRASHED,        //!< The vehicle is crashed (and will never run again).
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    88
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    89
		VS_INVALID = 0xFF, //!< An invalid vehicle state.
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    90
	};
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    91
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
    92
	/**
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    93
	 * 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
    94
	 * @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
    95
	 * @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
    96
	 */
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
    97
	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
    98
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    99
	/**
9699
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   100
	 * 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
   101
	 * @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
   102
	 * @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
   103
	 * @pre IsValidVehicle(vehicle_id).
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   104
	 * @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
   105
	 * @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
   106
	 * @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
   107
	 */
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
   108
	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
   109
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   110
	/**
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   111
	 * 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
   112
	 * @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
   113
	 * @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
   114
	 * @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
   115
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   116
	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
   117
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   118
	/**
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   119
	 * 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
   120
	 * @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
   121
	 * @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
   122
	 * @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
   123
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   124
	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
   125
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   126
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   127
	 * 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
   128
	 * @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
   129
	 * @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
   130
	 * @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
   131
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   132
	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
   133
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   134
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   135
	 * 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
   136
	 * @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
   137
	 * @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
   138
	 * @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
   139
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   140
	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
   141
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   142
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   143
	 * 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
   144
	 * @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
   145
	 * @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
   146
	 * @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
   147
	 * @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
   148
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   149
	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
   150
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   151
	/**
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
	 * 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
   153
	 * @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
   154
	 * @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
   155
	 * @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
   156
	 * @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
   157
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   158
	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
   159
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   160
	/**
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
   161
	 * 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
   162
	 * @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
   163
	 * @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
   164
	 * @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
   165
	 * @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
   166
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   167
	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
   168
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   169
	/**
10187
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10096
diff changeset
   170
	 * Get the current speed of a vehicle.
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10096
diff changeset
   171
	 * @param vehicle_id The vehicle to get the age of.
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10096
diff changeset
   172
	 * @pre IsValidVehicle(vehicle_id).
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10096
diff changeset
   173
	 * @return The current speed of the vehicle.
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10096
diff changeset
   174
	 * @note Speed is in km/h.
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10096
diff changeset
   175
	 */
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10096
diff changeset
   176
	static int32 GetCurrentSpeed(VehicleID vehicle_id);
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10096
diff changeset
   177
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10096
diff changeset
   178
	/**
10999
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
   179
	 * Get the current state of a vehicle.
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
   180
	 * @param vehicle_id The vehicle to get the state of.
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
   181
	 * @pre IsValidVehicle(vehicle_id).
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
   182
	 * @return The current state of the vehicle.
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
   183
	 */
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
   184
	static VehicleState GetState(VehicleID vehicle_id);
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
   185
f238f608f45c (svn r13553) [NoAI] -Add: function to determine the state of a vehicle (running, manually stopped, broken down, crashed etc.).
rubidium
parents: 10668
diff changeset
   186
	/**
9733
49e424cd4edd (svn r12212) [NoAI] -Add: added AIEngine::GetMaxAge, AIEngine::GetRunningCost and AIVehicle::GetRunningCost (Morloth)
truebrain
parents: 9723
diff changeset
   187
	 * 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
   188
	 * @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
   189
	 * @pre IsValidVehicle(vehicle_id).
49e424cd4edd (svn r12212) [NoAI] -Add: added AIEngine::GetMaxAge, AIEngine::GetRunningCost and AIVehicle::GetRunningCost (Morloth)
truebrain
parents: 9723
diff changeset
   190
	 * @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
   191
	 * @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
   192
	 * @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
   193
	 *   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
   194
	 */
49e424cd4edd (svn r12212) [NoAI] -Add: added AIEngine::GetMaxAge, AIEngine::GetRunningCost and AIVehicle::GetRunningCost (Morloth)
truebrain
parents: 9723
diff changeset
   195
	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
   196
49e424cd4edd (svn r12212) [NoAI] -Add: added AIEngine::GetMaxAge, AIEngine::GetRunningCost and AIVehicle::GetRunningCost (Morloth)
truebrain
parents: 9723
diff changeset
   197
	/**
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   198
	 * 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
   199
	 * @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
   200
	 * @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
   201
	 * @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
   202
	 */
10196
aecabd927420 (svn r12728) [NoAI] -Codechange: always let functions return Money when they return something that can be quantified as money.
rubidium
parents: 10189
diff changeset
   203
	static Money GetProfitThisYear(VehicleID vehicle_id);
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   204
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   205
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   206
	 * 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
   207
	 * @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
   208
	 * @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
   209
	 * @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
   210
	 */
10196
aecabd927420 (svn r12728) [NoAI] -Codechange: always let functions return Money when they return something that can be quantified as money.
rubidium
parents: 10189
diff changeset
   211
	static Money GetProfitLastYear(VehicleID vehicle_id);
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
   212
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   213
	/**
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   214
	 * 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
   215
	 * @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
   216
	 * @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
   217
	 * @return The vehicle type.
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   218
	 */
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   219
	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
   220
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   221
	/**
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10339
diff changeset
   222
	 * Get the RoadType of the vehicle.
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10339
diff changeset
   223
	 * @param vehicle_id The vhiecle to get the RoadType of.
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10339
diff changeset
   224
	 * @pre IsValidVehicle(vehicle_id).
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10339
diff changeset
   225
	 * @pre GetVehicleType(vehicle_id) == VEHICLE_ROAD.
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10339
diff changeset
   226
	 * @return The RoadType the vehicle has.
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10339
diff changeset
   227
	 */
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10339
diff changeset
   228
	static AIRoad::RoadType GetRoadType(VehicleID vehicle_id);
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10339
diff changeset
   229
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10339
diff changeset
   230
	/**
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   231
	 * 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
   232
	 * @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
   233
	 * @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
   234
	 * @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
   235
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   236
	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
   237
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   238
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   239
	 * 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
   240
	 * @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
   241
	 * @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
   242
	 * @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
   243
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   244
	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
   245
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   246
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   247
	 * 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
   248
	 * @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
   249
	 * @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
   250
	 * @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
   251
	 *   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
   252
	 * @pre IsValidEngine(engine_id).
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   253
	 * @exception AIVehicle::ERR_VEHICLE_TOO_MANY
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   254
	 * @exception AIVehicle::ERR_VEHICLE_BUILD_DISABLED
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   255
	 * @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
   256
	 * @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
   257
	 *   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
   258
	 *   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
   259
	 * @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
   260
	 *   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
   261
	 *   assigning orders.
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
	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
   264
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   265
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   266
	 * 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
   267
	 * @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
   268
	 * @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
   269
	 * @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
   270
	 * @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
   271
	 * @pre IsValidVehicle(vehicle_id).
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   272
	 * @exception AIVehicle::ERR_VEHICLE_TOO_MANY
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   273
	 * @exception AIVehicle::ERR_VEHICLE_BUILD_DISABLED
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   274
	 * @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
   275
	 * @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
   276
	 *   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
   277
	 *   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
   278
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   279
	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
   280
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   281
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   282
	 * 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
   283
	 * @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
   284
	 * @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
   285
	 * @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
   286
	 * @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
   287
	 * @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
   288
	 * @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
   289
	 * @exception AIVehicle::ERR_VEHICLE_CANNOT_REFIT
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   290
	 * @exception AIVehicle::ERR_VEHICLE_IS_DESTROYED
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   291
	 * @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
   292
	 * @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
   293
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   294
	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
   295
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   296
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   297
	 * 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
   298
	 * @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
   299
	 * @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
   300
	 * @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
   301
	 * @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
   302
	 * @exception AIVehicle::ERR_VEHICLE_IS_DESTROYED
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   303
	 * @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
   304
	 * @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
   305
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   306
	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
   307
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   308
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   309
	 * 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
   310
	 * @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
   311
	 * @pre IsValidVehicle(vehicle_id).
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   312
	 * @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
   313
	 * @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
   314
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   315
	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
   316
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   317
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   318
	 * 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
   319
	 * @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
   320
	 * @pre IsValidVehicle(vehicle_id).
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   321
	 * @exception AIVehicle::ERR_VEHICLE_CANNOT_START_STOP
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   322
	 * @exception (For aircraft only): AIVehicle::ERR_VEHICLE_IN_FLIGHT
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9838
diff changeset
   323
	 * @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
   324
	 * @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
   325
	 */
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   326
	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
   327
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   328
	/**
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9737
diff changeset
   329
	 * 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
   330
	 * @param vehicle_id The vehicle to skip the order for.
11029
776c7cc8bda5 (svn r13585) [NoAI] -Add: possibility to get information/perform order changes based on the current order of a vehicle.
rubidium
parents: 11000
diff changeset
   331
	 * @param order_position The selected order to which we want to skip.
776c7cc8bda5 (svn r13585) [NoAI] -Add: possibility to get information/perform order changes based on the current order of a vehicle.
rubidium
parents: 11000
diff changeset
   332
	 * @pre IsValidVehicleOrder(vehicle_id, order_position).
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
   333
	 * @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
   334
	 */
11029
776c7cc8bda5 (svn r13585) [NoAI] -Add: possibility to get information/perform order changes based on the current order of a vehicle.
rubidium
parents: 11000
diff changeset
   335
	static bool SkipToVehicleOrder(VehicleID vehicle_id, AIOrder::OrderPosition order_position);
10189
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   336
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   337
	/**
11168
3842648184cd (svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
truebrain
parents: 11057
diff changeset
   338
	 * Turn the given vehicle so it'll drive the other way.
3842648184cd (svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
truebrain
parents: 11057
diff changeset
   339
	 * @param vehicle_id The vehicle to turn.
3842648184cd (svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
truebrain
parents: 11057
diff changeset
   340
	 * @pre IsValidVehicle(vehicle_id).
3842648184cd (svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
truebrain
parents: 11057
diff changeset
   341
	 * @pre GetVehicleType(vehicle_id) == VEHICLE_ROAD || GetVehicleType(vehicle_id) == VEHICLE_RAIL.
3842648184cd (svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
truebrain
parents: 11057
diff changeset
   342
	 * @return True if and only if the vehicle has started to turn.
3842648184cd (svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
truebrain
parents: 11057
diff changeset
   343
	 * @note Vehicles cannot always be reversed. For example busses and trucks need to be running
3842648184cd (svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
truebrain
parents: 11057
diff changeset
   344
	 *  and not be inside a depot.
3842648184cd (svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
truebrain
parents: 11057
diff changeset
   345
	 */
3842648184cd (svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
truebrain
parents: 11057
diff changeset
   346
	static bool ReverseVehicle(VehicleID vehicle_id);
3842648184cd (svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
truebrain
parents: 11057
diff changeset
   347
3842648184cd (svn r13726) [NoAI] -Add: AIVehicle::ReverseVehicle (Yexo)
truebrain
parents: 11057
diff changeset
   348
	/**
10189
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   349
	 * Get the maximum amount of a specific cargo the given vehicle can transport.
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   350
	 * @param vehicle_id The vehicle to get the capacity of.
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   351
	 * @param cargo The cargo to get the capacity for.
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   352
	 * @pre IsValidVehicle(vehicle_id).
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   353
	 * @pre AICargo::IsValidCargo(cargo).
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   354
	 * @return The maximum amount of the given cargo the vehicle can transport.
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   355
	 */
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   356
	static int32 GetCapacity(VehicleID vehicle_id, CargoID cargo);
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   357
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   358
	/**
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   359
	 * Get the amount of a specific cargo the given vehicle transports.
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   360
	 * @param vehicle_id The vehicle to get the load amount of.
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   361
	 * @param cargo The cargo to get the load amount for.
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   362
	 * @pre IsValidVehicle(vehicle_id).
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   363
	 * @pre AICargo::IsValidCargo(cargo).
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   364
	 * @return The amount of the given cargo the vehicle currently transports.
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   365
	 */
b18d1d5b047d (svn r12720) [NoAI] -Add: functions to get the capacity/current load of a vehicle given a cargo type.
rubidium
parents: 10187
diff changeset
   366
	static int32 GetCargoLoad(VehicleID vehicle_id, CargoID cargo);
11057
188a9ca6d8de (svn r13614) [NoAI] -Add: AIGroup which allows an AI to manage its vehicle in the context of groups.
rubidium
parents: 11029
diff changeset
   367
188a9ca6d8de (svn r13614) [NoAI] -Add: AIGroup which allows an AI to manage its vehicle in the context of groups.
rubidium
parents: 11029
diff changeset
   368
	/**
188a9ca6d8de (svn r13614) [NoAI] -Add: AIGroup which allows an AI to manage its vehicle in the context of groups.
rubidium
parents: 11029
diff changeset
   369
	 * Get the group of a given vehicle.
188a9ca6d8de (svn r13614) [NoAI] -Add: AIGroup which allows an AI to manage its vehicle in the context of groups.
rubidium
parents: 11029
diff changeset
   370
	 * @param vehicle_id The vehicle to get the group from.
188a9ca6d8de (svn r13614) [NoAI] -Add: AIGroup which allows an AI to manage its vehicle in the context of groups.
rubidium
parents: 11029
diff changeset
   371
	 * @return The group of the given vehicle.
188a9ca6d8de (svn r13614) [NoAI] -Add: AIGroup which allows an AI to manage its vehicle in the context of groups.
rubidium
parents: 11029
diff changeset
   372
	 */
188a9ca6d8de (svn r13614) [NoAI] -Add: AIGroup which allows an AI to manage its vehicle in the context of groups.
rubidium
parents: 11029
diff changeset
   373
	static GroupID GetGroupID(VehicleID vehicle_id);
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   374
};
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   375
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   376
#endif /* AI_VEHICLE_HPP */