src/ai/api/ai_vehicle.hpp
author rubidium
Sun, 15 Jul 2007 16:39:11 +0000
branchnoai
changeset 9668 6fe3d2cb9655
parent 9654 b836eb5c521f
child 9672 18c71ca987e4
permissions -rw-r--r--
(svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
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:
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    16
	/**
9529
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    17
	 * 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
    18
	 */
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    19
	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
    20
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    21
	/**
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    22
	 * Checks whether the given engine type is valid and buildable by you.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    23
	 * @param engine_id the engine to check.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    24
	 * @return true if and only if the engine type is valid.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    25
	 */
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
    26
	static bool IsValidEngine(EngineID engine_id);
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    27
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    28
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    29
	 * 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
    30
	 * @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
    31
	 * @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
    32
	 */
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
    33
	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
    34
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    35
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    36
	 * Find the best road vehicle for this job, given a minimum reliability.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    37
	 * @param cargo           the cargo the vehicle has to transport.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    38
	 * @param min_reliability the minimum reliability of the vehicle,
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    39
	 *   between 0 and 100.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    40
	 * @pre AICargo::IsValidCargo(cargo).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    41
	 * @pre min_reliability is between 0 and 100.
9522
f6c7f9f213c5 (svn r9442) [NoAI] -Documentation: do not reference any non-exported INVALID_* in the AI API documentation.
rubidium
parents: 9520
diff changeset
    42
	 * @return the engine with the best characteristics, or an invalid engine
f6c7f9f213c5 (svn r9442) [NoAI] -Documentation: do not reference any non-exported INVALID_* in the AI API documentation.
rubidium
parents: 9520
diff changeset
    43
	 *   when no engine was found given the cargo and reliability. Check the
f6c7f9f213c5 (svn r9442) [NoAI] -Documentation: do not reference any non-exported INVALID_* in the AI API documentation.
rubidium
parents: 9520
diff changeset
    44
	 *   return value using IsValidEngine.
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    45
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    46
	EngineID FindBestRoadVehicle(CargoID cargo, uint8 min_reliability);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    47
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    48
	/**
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    49
	 * Find the best aircraft for this job, given a minimum reliability.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    50
	 * @param cargo           the cargo the vehicle has to transport.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    51
	 * @param min_reliability the minimum reliability of the vehicle,
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    52
	 *   between 0 and 100.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    53
	 * @pre AICargo::IsValidCargo(cargo).
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    54
	 * @pre min_reliability is between 0 and 100.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    55
	 * @return the engine with the best characteristics, or an invalid engine
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    56
	 *   when no engine was found given the cargo and reliability. Check the
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    57
	 *   return value using IsValidEngine.
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    58
	 */
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    59
	EngineID FindBestAircraftVehicle(CargoID cargo, uint8 min_reliability);
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    60
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
    61
	/**
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    62
	 * 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
    63
	 * @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
    64
	 * @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
    65
	 * @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
    66
	 *   is owned by you.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    67
	 * @pre IsValidEngine(engine_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    68
	 * @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
    69
	 *   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
    70
	 *   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
    71
	 * @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
    72
	 *   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
    73
	 *   assigning orders.
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    74
	 */
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
    75
	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
    76
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    77
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    78
	 * 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
    79
	 * @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
    80
	 * @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
    81
	 * @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
    82
	 * @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
    83
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    84
	 * @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
    85
	 *   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
    86
	 *   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
    87
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    88
	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
    89
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    90
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    91
	 * 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
    92
	 * @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
    93
	 * @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
    94
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    95
	 * @pre AICargo::IsValidCargo(cargo)
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    96
	 * @pre you must own the vehicle
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    97
	 * @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
    98
	 * @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
    99
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   100
	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
   101
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   102
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   103
	 * Sells the given vehicle.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   104
	 * @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
   105
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   106
	 * @pre you must own the vehicle
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   107
	 * @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
   108
	 * @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
   109
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   110
	bool SellVehicle(VehicleID vehicle_id);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   111
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   112
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   113
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   114
	 * 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
   115
	 * @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
   116
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   117
	 * @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
   118
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   119
	bool SendVehicleToDepot(VehicleID vehicle_id);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   120
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
	 * 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
   123
	 * @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
   124
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   125
	 * @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
   126
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   127
	bool StartStopVehicle(VehicleID vehicle_id);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   128
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   129
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   130
	 * 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
   131
	 * @param vehicle_id the vehicle to skip the order for.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   132
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   133
	 * @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
   134
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   135
	bool SkipVehicleOrder(VehicleID vehicle_id);
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   136
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   137
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   138
	 * 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
   139
	 * @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
   140
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   141
	 * @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
   142
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   143
	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
   144
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   145
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   146
	 * 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
   147
	 * @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
   148
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   149
	 * @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
   150
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   151
	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
   152
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   153
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   154
	 * 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
   155
	 * @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
   156
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   157
	 * @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
   158
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   159
	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
   160
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   161
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   162
	 * 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
   163
	 * @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
   164
	 * @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
   165
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   166
	 * @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
   167
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   168
	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
   169
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   170
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   171
	 * 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
   172
	 * @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
   173
	 * @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
   174
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   175
	 * @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
   176
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   177
	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
   178
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   179
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   180
	 * 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
   181
	 * @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
   182
	 * @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
   183
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   184
	 * @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
   185
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   186
	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
   187
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   188
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   189
	 * 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
   190
	 * @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
   191
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   192
	 * @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
   193
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   194
	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
   195
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   196
	/**
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   197
	 * 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
   198
	 * @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
   199
	 * @pre IsValidVehicle(vehicle_id).
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   200
	 * @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
   201
	 */
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9596
diff changeset
   202
	static int32 GetProfitLastYear(VehicleID vehicle_id);
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
   203
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
   204
private:
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9615
diff changeset
   205
	EngineID FindBestVehicle(CargoID cargo, uint8 min_reliability, VehicleType veh_type);
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   206
};
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   207
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   208
#endif /* AI_VEHICLE_HPP */