src/ai/api/ai_vehicle.hpp.sq
author truelight
Sat, 14 Jul 2007 21:15:49 +0000
branchnoai
changeset 9657 f2c6e332d8bc
parent 9654 b836eb5c521f
child 9672 18c71ca987e4
permissions -rw-r--r--
(svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     1
#include "ai_vehicle.hpp"
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     2
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     3
namespace SQConvert {
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     4
	/* Allow AIVehicle to be used as Squirrel parameter */
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     5
	template <> AIVehicle *GetParam(ForceType<AIVehicle *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIVehicle *)instance; }
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     6
	template <> AIVehicle &GetParam(ForceType<AIVehicle &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicle *)instance; }
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     7
	template <> const AIVehicle *GetParam(ForceType<const AIVehicle *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIVehicle *)instance; }
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     8
	template <> const AIVehicle &GetParam(ForceType<const AIVehicle &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicle *)instance; }
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     9
}; // namespace SQConvert
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    10
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    11
void SQAIVehicleRegister(Squirrel *engine) {
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    12
	DefSQClass <AIVehicle> SQAIVehicle("AIVehicle");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    13
	SQAIVehicle.PreRegister(engine);
9635
9ee82e091af7 (svn r10526) [NoAI] -Fix: a class with params for the constructor lost his instance when called from SQ (templates can be really useful ;))
truelight
parents: 9615
diff changeset
    14
	SQAIVehicle.AddConstructor<void (AIVehicle::*)(), 1>(engine, "x");
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    15
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9610
diff changeset
    16
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::GetClassName,      "GetClassName",      1, "x");
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9610
diff changeset
    17
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::IsValidEngine,     "IsValidEngine",     2, "xi");
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9610
diff changeset
    18
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::IsValidVehicle,    "IsValidVehicle",    2, "xi");
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9610
diff changeset
    19
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::GetLocation,       "GetLocation",       2, "xi");
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9610
diff changeset
    20
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::GetEngineType,     "GetEngineType",     2, "xi");
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9610
diff changeset
    21
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::GetUnitNumber,     "GetUnitNumber",     2, "xi");
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9610
diff changeset
    22
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::GetAge,            "GetAge",            2, "xi");
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9610
diff changeset
    23
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::GetMaxAge,         "GetMaxAge",         2, "xi");
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9610
diff changeset
    24
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::GetAgeLeft,        "GetAgeLeft",        2, "xi");
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9610
diff changeset
    25
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::GetProfitThisYear, "GetProfitThisYear", 2, "xi");
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9610
diff changeset
    26
	SQAIVehicle.DefSQStaticMethod(engine, &AIVehicle::GetProfitLastYear, "GetProfitLastYear", 2, "xi");
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    27
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9635
diff changeset
    28
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::FindBestRoadVehicle,     "FindBestRoadVehicle",     3, "xii");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9635
diff changeset
    29
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::FindBestAircraftVehicle, "FindBestAircraftVehicle", 3, "xii");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9635
diff changeset
    30
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::BuildVehicle,            "BuildVehicle",            3, "xii");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9635
diff changeset
    31
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::CloneVehicle,            "CloneVehicle",            4, "xiib");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9635
diff changeset
    32
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::RefitVehicle,            "RefitVehicle",            3, "xii");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9635
diff changeset
    33
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::SellVehicle,             "SellVehicle",             2, "xi");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9635
diff changeset
    34
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::SendVehicleToDepot,      "SendVehicleToDepot",      2, "xi");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9635
diff changeset
    35
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::StartStopVehicle,        "StartStopVehicle",        2, "xi");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9635
diff changeset
    36
	SQAIVehicle.DefSQMethod(engine, &AIVehicle::SkipVehicleOrder,        "SkipVehicleOrder",        2, "xi");
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    37
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    38
	SQAIVehicle.PostRegister(engine);
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    39
}