author | rubidium |
Sun, 25 Mar 2007 22:21:12 +0000 | |
branch | noai |
changeset 9541 | 4bb34cea7fad |
parent 9539 | 7416d0694d3a |
child 9550 | 31e558ce0c04 |
permissions | -rw-r--r-- |
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 true if and only if the vehicle has been build. |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
57 |
* @return the VehicleID of the new vehicle, or an invalid VehicleID when |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
58 |
* it failed. Check the return value using IsValidVehicle. |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
59 |
*/ |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
60 |
VehicleID BuildVehicle(TileIndex depot, EngineID vehicle_id); |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
61 |
|
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
62 |
/** |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
63 |
* 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
|
64 |
* @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
|
65 |
* @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
|
66 |
* @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
|
67 |
* @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
|
68 |
* @pre IsValidVehicle(vehicle_id). |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
69 |
* @return the VehicleID of the new vehicle, or an invalid VehicleID when |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
70 |
* it failed. Check the return value using IsValidVehicle. |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
71 |
*/ |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
72 |
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
|
73 |
|
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
74 |
/** |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
75 |
* 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
|
76 |
* @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
|
77 |
* @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
|
78 |
* @pre IsValidVehicle(vehicle_id). |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
79 |
* @pre AICargo::IsValidCargo(cargo) |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
80 |
* @pre you must own the vehicle |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
81 |
* @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
|
82 |
* @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
|
83 |
*/ |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
84 |
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
|
85 |
|
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
86 |
/** |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
87 |
* Sells the given vehicle. |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
88 |
* @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
|
89 |
* @pre IsValidVehicle(vehicle_id). |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
90 |
* @pre you must own the vehicle |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
91 |
* @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
|
92 |
* @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
|
93 |
*/ |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
94 |
bool SellVehicle(VehicleID vehicle_id); |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
95 |
|
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
96 |
|
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 |
* 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
|
99 |
* @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
|
100 |
* @pre IsValidVehicle(vehicle_id). |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
101 |
* @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
|
102 |
*/ |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
103 |
bool SendVehicleToDepot(VehicleID vehicle_id); |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
104 |
|
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
105 |
/** |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
106 |
* 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
|
107 |
* @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
|
108 |
* @pre IsValidVehicle(vehicle_id). |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
109 |
* @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
|
110 |
*/ |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
111 |
bool StartStopVehicle(VehicleID vehicle_id); |
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 |
* 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
|
115 |
* @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
|
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 order has been skipped. |
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 SkipVehicleOrder(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 |
#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
|
123 |
namespace SQConvert { |
283d23931bb4
(svn r9444) [NoAI] -Codechange: allow all API-class-instances to be used as parameters in Squirrel.
rubidium
parents:
9522
diff
changeset
|
124 |
/* 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
|
125 |
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
|
126 |
}; // namespace SQConvert |
283d23931bb4
(svn r9444) [NoAI] -Codechange: allow all API-class-instances to be used as parameters in Squirrel.
rubidium
parents:
9522
diff
changeset
|
127 |
|
9491
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
128 |
void SQAIVehicleRegister(Squirrel *engine) { |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
129 |
DefSQClass <AIVehicle> SQAIVehicle("AIVehicle"); |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
130 |
SQAIVehicle.PreRegister(engine); |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
131 |
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
|
132 |
|
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
|
133 |
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
|
134 |
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
|
135 |
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
|
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.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
|
138 |
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
|
139 |
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
|
140 |
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
|
141 |
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
|
142 |
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
|
143 |
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
|
144 |
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
|
145 |
|
9491
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
146 |
SQAIVehicle.PostRegister(engine); |
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
147 |
} |
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
|
148 |
#endif /* DEFINE_SQUIRREL_CLASS */ |
9491
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
149 |
|
351239ad524c
(svn r9361) [NoAI] -Add: some function to find, build and sell road vehicles.
rubidium
parents:
diff
changeset
|
150 |
#endif /* AI_VEHICLE_HPP */ |