src/ai/api/ai_vehicle.hpp
author truelight
Fri, 19 Oct 2007 11:32:20 +0000
branchnoai
changeset 9711 c8b427215c9d
parent 9709 196a08fbfeb6
child 9712 ceb5e4fcb7b1
permissions -rw-r--r--
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
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
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
     3
/** @file ai_vehicle.hpp Everything to query and build vehicles */
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"
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
     9
#include "../../vehicle.h"
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    10
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
 * 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
    13
 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    14
class AIVehicle : public AIObject {
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    15
public:
9685
d988aad9fc52 (svn r10634) [NoAI] -Documentation: of course I forgot to document the VehicleType enum
truelight
parents: 9684
diff changeset
    16
	/**
d988aad9fc52 (svn r10634) [NoAI] -Documentation: of course I forgot to document the VehicleType enum
truelight
parents: 9684
diff changeset
    17
	 * 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
    18
	 *  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
    19
	 */
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    20
	enum VehicleType {
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    21
		/* Order IS important, as it now matches the internal state of the game for vehicle type */
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    22
		VEHICLE_RAIL,
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    23
		VEHICLE_ROAD,
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    24
		VEHICLE_WATER,
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    25
		VEHICLE_AIR,
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    26
		VEHICLE_INVALID = 0xFF,
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    27
	};
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
    28
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    29
	/**
9529
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    30
	 * The name of the class, needed by several sub-processes.
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    31
	 */
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    32
	static const char *GetClassName() { return "AIVehicle"; }
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    33
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    34
	/**
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    35
	 * Checks whether the given vehicle is valid and owned by you.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    36
	 * @param vehicle_id the vehicle to check.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    37
	 * @return true if and only if the vehicle is valid.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    38
	 */
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
    39
	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
    40
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    41
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    42
	 * Builds a vehicle with the given engine at the given depot.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    43
	 * @param depot     the depot where the vehicle will be build.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    44
	 * @param engine_id the engine to use for this vehicle.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    45
	 * @pre the tile at depot has a depot that can build the engine and
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    46
	 *   is owned by you.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    47
	 * @pre IsValidEngine(engine_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    48
	 * @return the VehicleID of the new vehicle, or an invalid VehicleID when
9562
2f4087d63527 (svn r9500) [NoAI] -Add: document behavoir in test-mode
truelight
parents: 9559
diff changeset
    49
	 *   it failed. Check the return value using IsValidVehicle. In test-mode
2f4087d63527 (svn r9500) [NoAI] -Add: document behavoir in test-mode
truelight
parents: 9559
diff changeset
    50
	 *   0 is returned if it was successful; any other value indicates failure.
9563
2c0a7ea15d4c (svn r9501) [NoAI] -Add: document that you can't assign orders to a vehicle build in test-mode
truelight
parents: 9562
diff changeset
    51
	 * @note in test-mode it means you can't assign orders yet to this vehicle,
2c0a7ea15d4c (svn r9501) [NoAI] -Add: document that you can't assign orders to a vehicle build in test-mode
truelight
parents: 9562
diff changeset
    52
	 *   as the vehicle isn't really built yet. Build it for real first before
2c0a7ea15d4c (svn r9501) [NoAI] -Add: document that you can't assign orders to a vehicle build in test-mode
truelight
parents: 9562
diff changeset
    53
	 *   assigning orders.
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    54
	 */
9550
31e558ce0c04 (svn r9487) [NoAI] -Fix: BuildVehicle had as param vehicle_id in .hpp, which of course should be engine_id
truelight
parents: 9541
diff changeset
    55
	VehicleID BuildVehicle(TileIndex depot, EngineID engine_id);
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    56
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    57
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    58
	 * Clones a vehicle at the given depot, copying or cloning it's orders.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    59
	 * @param depot        the depot where the vehicle will be build.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    60
	 * @param vehicle_id   the vehicle to use as example for the new vehicle.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    61
	 * @param share_orders should the orders be copied or shared?
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    62
	 * @pre the tile at depot has a depot.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    63
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    64
	 * @return the VehicleID of the new vehicle, or an invalid VehicleID when
9562
2f4087d63527 (svn r9500) [NoAI] -Add: document behavoir in test-mode
truelight
parents: 9559
diff changeset
    65
	 *   it failed. Check the return value using IsValidVehicle. In test-mode
2f4087d63527 (svn r9500) [NoAI] -Add: document behavoir in test-mode
truelight
parents: 9559
diff changeset
    66
	 *   0 is returned if it was successful; any other value indicates failure.
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    67
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    68
	VehicleID CloneVehicle(TileIndex depot, VehicleID vehicle_id, bool share_orders);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    69
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    70
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    71
	 * Refits a vehicle to the given cargo type
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    72
	 * @param vehicle_id the vehicle to refit
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    73
	 * @param cargo      the cargo to refit to
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    74
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    75
	 * @pre AICargo::IsValidCargo(cargo)
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    76
	 * @pre you must own the vehicle
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    77
	 * @pre the vehicle must be stopped in the depot
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    78
	 * @return true if and only if the refit succeeded.
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
	bool RefitVehicle(VehicleID vehicle_id, CargoID cargo);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    81
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    82
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    83
	 * Sells the given vehicle.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    84
	 * @param vehicle_id the vehicle to sell.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    85
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    86
	 * @pre you must own the vehicle
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    87
	 * @pre the vehicle must be stopped in the depot
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    88
	 * @return true if and only if the vehicle has been sold.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    89
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    90
	bool SellVehicle(VehicleID vehicle_id);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    91
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    92
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    93
	 * Sends the given vehicle to a depot.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    94
	 * @param vehicle_id the vehicle to send to a depot.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    95
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    96
	 * @return true if and only if the vehicle has been sent to a depot.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    97
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    98
	bool SendVehicleToDepot(VehicleID vehicle_id);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    99
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   100
	/**
9709
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   101
	 * Check if a vehicle is in a depot.
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   102
	 * @param vehicle_id the vehicle to check.
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   103
	 * @pre isValidVehicle(vehicle_id).
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   104
	 * @return true if and only if the vehicle is in a depot.
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   105
	 */
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   106
	bool IsInDepot(VehicleID vehicle_id);
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   107
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   108
	/**
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   109
	 * Check if a vehicle is in a depot and stopped.
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   110
	 * @param vehicle_id the vehicle to check.
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   111
	 * @pre isValidVehicle(vehicle_id).
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   112
	 * @return true if and only if the vehicle is in a depot and stopped.
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   113
	 */
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   114
	bool IsStoppedInDepot(VehicleID vehicle_id);
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   115
196a08fbfeb6 (svn r11289) [NoAI] -Add [FS#1346]: added AIVehicle::Is(Stopped)InDepot() (dihedral)
truelight
parents: 9706
diff changeset
   116
	/**
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   117
	 * Starts or stops the given vehicle depending on the current state.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   118
	 * @param vehicle_id the vehicle to start/stop.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   119
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   120
	 * @return true if and only if the vehicle has been started or stopped.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   121
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   122
	bool StartStopVehicle(VehicleID vehicle_id);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   123
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   124
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   125
	 * Skips the current order of the given vehicle.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   126
	 * @param vehicle_id the vehicle to skip the order for.
9706
8d8f719a4e69 (svn r11250) [NoAI] -Fix [API CHANGE]: SkipVehicleOrder always skipped to first vehicle order.. replaced with SkipToVehicleOrder, and added a param to specify to which order it should skip (dynaxo)
truelight
parents: 9699
diff changeset
   127
	 * @param order_id the selected order to which we want to skip.
8d8f719a4e69 (svn r11250) [NoAI] -Fix [API CHANGE]: SkipVehicleOrder always skipped to first vehicle order.. replaced with SkipToVehicleOrder, and added a param to specify to which order it should skip (dynaxo)
truelight
parents: 9699
diff changeset
   128
	 * @pre IsValidVehicleOrder(vehicle_id, order_id).
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   129
	 * @return true if and only if the order has been skipped.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   130
	 */
9706
8d8f719a4e69 (svn r11250) [NoAI] -Fix [API CHANGE]: SkipVehicleOrder always skipped to first vehicle order.. replaced with SkipToVehicleOrder, and added a param to specify to which order it should skip (dynaxo)
truelight
parents: 9699
diff changeset
   131
	bool SkipToVehicleOrder(VehicleID vehicle_id, uint32 order_id);
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   132
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   133
	/**
9699
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   134
	 * Set the name of a vehicle.
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   135
	 * @param vehicle_id the vehicle to set the name for.
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   136
	 * @param name the name for the vehicle.
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   137
	 * @pre IsValidVehicle(vehicle_id).
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   138
	 * @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
   139
	 * @pre You have to own the vehicle.
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   140
	 * @return true if and only if the name was changed.
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   141
	 */
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   142
	bool SetName(VehicleID vehicle_id, const char *name);
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   143
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   144
	/**
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   145
	 * Get the current location of a vehicle.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   146
	 * @param vehicle_id the vehicle to get the location of.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   147
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   148
	 * @return the tile the vehicle is currently on.
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
	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
   151
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   152
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   153
	 * Get the engine-type of a vehicle.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   154
	 * @param vehicle_id the vehicle to get the engine-type of.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   155
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   156
	 * @return the engine type the vehicle has.
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 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
   159
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   160
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   161
	 * Get the unitnumber of a vehicle.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   162
	 * @param vehicle_id the vehicle to get the unitnumber of.
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).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   164
	 * @return the unitnumber the vehicle has.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   165
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   166
	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
   167
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   168
	/**
9699
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   169
	 * Get the name of a vehicle.
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   170
	 * @param vehicle_id the vehicle to get the unitnumber of.
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   171
	 * @pre IsValidVehicle(vehicle_id).
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   172
	 * @return the name the vehicle has.
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   173
	 */
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   174
	static char *GetName(VehicleID vehicle_id);
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   175
e1b5f29cc6f9 (svn r10940) [NoAI] -Add: added AIVehicle::GetName and AIVehicle::SetName to set vehicle names
truelight
parents: 9691
diff changeset
   176
	/**
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   177
	 * Get the current age of a vehicle.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   178
	 * @note age is in days.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   179
	 * @param vehicle_id the vehicle to get the age of.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   180
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   181
	 * @return the current age the vehicle has.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   182
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   183
	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
   184
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   185
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   186
	 * Get the max age of a vehicle.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   187
	 * @note age is in days.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   188
	 * @param vehicle_id the vehicle to get the age of.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   189
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   190
	 * @return the max age the vehicle has.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   191
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   192
	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
   193
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   194
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   195
	 * Get the age a vehicle has left (max - current).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   196
	 * @note age is in days.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   197
	 * @param vehicle_id the vehicle to get the age of.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   198
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   199
	 * @return the age the vehicle has left.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   200
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   201
	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
   202
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   203
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   204
	 * Get the current profit of a vehicle.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   205
	 * @param vehicle_id the vehicle to get the profit of.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   206
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   207
	 * @return the current profit the vehicle has.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   208
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   209
	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
   210
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   211
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   212
	 * Get the profit of last year of a vehicle.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   213
	 * @param vehicle_id the vehicle to get the profit of.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   214
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   215
	 * @return the profit the vehicle had last year.
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   216
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   217
	static int32 GetProfitLastYear(VehicleID vehicle_id);
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
   218
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   219
	/**
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   220
	 * Get the type of vehicle.
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   221
	 * @param vehicle_id the vehicle to get the type of.
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   222
	 * @pre IsValidVehicle(vehicle_id).
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   223
	 * @return the vehicle type.
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   224
	 */
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9672
diff changeset
   225
	static AIVehicle::VehicleType GetVehicleType(VehicleID vehicle_id);
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   226
};
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   227
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   228
#endif /* AI_VEHICLE_HPP */