src/ai/api/ai_vehicle.hpp
author truelight
Tue, 27 Mar 2007 11:56:05 +0000
branchnoai
changeset 9563 2c0a7ea15d4c
parent 9562 2f4087d63527
child 9594 5009a30f320a
permissions -rw-r--r--
(svn r9501) [NoAI] -Add: document that you can't assign orders to a vehicle build in test-mode
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"
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
     9
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
 * 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
    12
 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    13
class AIVehicle : public AIObject {
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    14
public:
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    15
	/**
9529
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    16
	 * 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
    17
	 */
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    18
	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
    19
5f26f4bc574b (svn r9450) [NoAI] -Fix: don't allow static-method calls from SQ to non-static functions
truelight
parents: 9526
diff changeset
    20
	/**
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    21
	 * 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
    22
	 * @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
    23
	 * @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
    24
	 */
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
    25
	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
    26
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
	 * 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
    29
	 * @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
    30
	 * @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
    31
	 */
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
    32
	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
    33
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
	 * 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
    36
	 * @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
    37
	 * @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
    38
	 *   between 0 and 100.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    39
	 * @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
    40
	 *   is owned by you.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    41
	 * @pre AICargo::IsValidCargo(cargo).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    42
	 * @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
    43
	 * @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
    44
	 *   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
    45
	 *   return value using IsValidEngine.
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    46
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    47
	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
    48
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    49
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    50
	 * 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
    51
	 * @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
    52
	 * @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
    53
	 * @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
    54
	 *   is owned by you.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    55
	 * @pre IsValidEngine(engine_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    56
	 * @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
    57
	 *   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
    58
	 *   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
    59
	 * @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
    60
	 *   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
    61
	 *   assigning orders.
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    62
	 */
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
    63
	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
    64
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    65
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    66
	 * 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
    67
	 * @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
    68
	 * @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
    69
	 * @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
    70
	 * @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
    71
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    72
	 * @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
    73
	 *   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
    74
	 *   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
    75
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    76
	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
    77
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    78
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    79
	 * 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
    80
	 * @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
    81
	 * @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
    82
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    83
	 * @pre AICargo::IsValidCargo(cargo)
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    84
	 * @pre you must own the vehicle
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    85
	 * @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
    86
	 * @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
    87
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    88
	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
    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
	 * Sells the given vehicle.
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 sell.
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    93
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    94
	 * @pre you must own the vehicle
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    95
	 * @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
    96
	 * @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
    97
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
    98
	bool SellVehicle(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
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
	 * 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
   103
	 * @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
   104
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   105
	 * @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
   106
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   107
	bool SendVehicleToDepot(VehicleID vehicle_id);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   108
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
	 * 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
   111
	 * @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
   112
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   113
	 * @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
   114
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   115
	bool StartStopVehicle(VehicleID vehicle_id);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   116
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   117
	/**
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   118
	 * 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
   119
	 * @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
   120
	 * @pre IsValidVehicle(vehicle_id).
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   121
	 * @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
   122
	 */
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   123
	bool SkipVehicleOrder(VehicleID vehicle_id);
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
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   126
#ifdef DEFINE_SQUIRREL_CLASS
9524
283d23931bb4 (svn r9444) [NoAI] -Codechange: allow all API-class-instances to be used as parameters in Squirrel.
rubidium
parents: 9522
diff changeset
   127
namespace SQConvert {
283d23931bb4 (svn r9444) [NoAI] -Codechange: allow all API-class-instances to be used as parameters in Squirrel.
rubidium
parents: 9522
diff changeset
   128
	/* Allow AIVehicle to be used as Squirrel parameter */
283d23931bb4 (svn r9444) [NoAI] -Codechange: allow all API-class-instances to be used as parameters in Squirrel.
rubidium
parents: 9522
diff changeset
   129
	template <> AIVehicle *GetParam(ForceType<AIVehicle *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicle *)instance; }
283d23931bb4 (svn r9444) [NoAI] -Codechange: allow all API-class-instances to be used as parameters in Squirrel.
rubidium
parents: 9522
diff changeset
   130
}; // namespace SQConvert
283d23931bb4 (svn r9444) [NoAI] -Codechange: allow all API-class-instances to be used as parameters in Squirrel.
rubidium
parents: 9522
diff changeset
   131
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   132
void SQAIVehicleRegister(Squirrel *engine) {
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   133
	DefSQClass <AIVehicle> SQAIVehicle("AIVehicle");
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   134
	SQAIVehicle.PreRegister(engine);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   135
	SQAIVehicle.AddConstructor(engine);
9526
a4ad60ba03be (svn r9446) [NoAI] -Add: simple script to make changing/adding classes to export a little simpler.
rubidium
parents: 9524
diff changeset
   136
9541
4bb34cea7fad (svn r9463) [NoAI] -Codechange: update squirrel export script to generate the correct amount and type of parameters, so that can be checked.
rubidium
parents: 9539
diff changeset
   137
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::GetClassName,   "GetClassName",   1, "x");
4bb34cea7fad (svn r9463) [NoAI] -Codechange: update squirrel export script to generate the correct amount and type of parameters, so that can be checked.
rubidium
parents: 9539
diff changeset
   138
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::IsValidEngine,  "IsValidEngine",  2, "xi");
9539
7416d0694d3a (svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents: 9532
diff changeset
   139
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::IsValidVehicle, "IsValidVehicle", 2, "xi");
9532
539c48d64eea (svn r9453) [NoAI] -Codechange: make a difference between static and non-static methods in the squirrel export script.
rubidium
parents: 9530
diff changeset
   140
9541
4bb34cea7fad (svn r9463) [NoAI] -Codechange: update squirrel export script to generate the correct amount and type of parameters, so that can be checked.
rubidium
parents: 9539
diff changeset
   141
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::FindBestRoadVehicle, "FindBestRoadVehicle", 3, "xii");
4bb34cea7fad (svn r9463) [NoAI] -Codechange: update squirrel export script to generate the correct amount and type of parameters, so that can be checked.
rubidium
parents: 9539
diff changeset
   142
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::BuildVehicle,        "BuildVehicle",        3, "xii");
4bb34cea7fad (svn r9463) [NoAI] -Codechange: update squirrel export script to generate the correct amount and type of parameters, so that can be checked.
rubidium
parents: 9539
diff changeset
   143
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::CloneVehicle,        "CloneVehicle",        4, "xiib");
4bb34cea7fad (svn r9463) [NoAI] -Codechange: update squirrel export script to generate the correct amount and type of parameters, so that can be checked.
rubidium
parents: 9539
diff changeset
   144
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::RefitVehicle,        "RefitVehicle",        3, "xii");
4bb34cea7fad (svn r9463) [NoAI] -Codechange: update squirrel export script to generate the correct amount and type of parameters, so that can be checked.
rubidium
parents: 9539
diff changeset
   145
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::SellVehicle,         "SellVehicle",         2, "xi");
4bb34cea7fad (svn r9463) [NoAI] -Codechange: update squirrel export script to generate the correct amount and type of parameters, so that can be checked.
rubidium
parents: 9539
diff changeset
   146
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::SendVehicleToDepot,  "SendVehicleToDepot",  2, "xi");
4bb34cea7fad (svn r9463) [NoAI] -Codechange: update squirrel export script to generate the correct amount and type of parameters, so that can be checked.
rubidium
parents: 9539
diff changeset
   147
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::StartStopVehicle,    "StartStopVehicle",    2, "xi");
4bb34cea7fad (svn r9463) [NoAI] -Codechange: update squirrel export script to generate the correct amount and type of parameters, so that can be checked.
rubidium
parents: 9539
diff changeset
   148
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::SkipVehicleOrder,    "SkipVehicleOrder",    2, "xi");
9526
a4ad60ba03be (svn r9446) [NoAI] -Add: simple script to make changing/adding classes to export a little simpler.
rubidium
parents: 9524
diff changeset
   149
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   150
	SQAIVehicle.PostRegister(engine);
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   151
}
9520
f7cf8bea10db (svn r9440) [NoAI] -Codechange: use the identifier used for the #ifdef in the #endif not something that looks like the identifier.
rubidium
parents: 9497
diff changeset
   152
#endif /* DEFINE_SQUIRREL_CLASS */
9491
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   153
351239ad524c (svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff changeset
   154
#endif /* AI_VEHICLE_HPP */