src/ai/api/ai_stationlist.hpp.sq
author truelight
Wed, 18 Jul 2007 14:58:37 +0000
branchnoai
changeset 9673 ee4f133c84ec
parent 9670 820b77e19bb3
child 9674 15f7b310b6cf
permissions -rw-r--r--
(svn r10612) [NoAI] -Add: allow a class as return value; pack the result in a SQ instance and it should work perfectly
9636
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
     1
#include "ai_stationlist.hpp"
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
     2
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
     3
namespace SQConvert {
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
     4
	/* Allow AIStationList to be used as Squirrel parameter */
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
     5
	template <> AIStationList *GetParam(ForceType<AIStationList *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIStationList *)instance; }
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
     6
	template <> AIStationList &GetParam(ForceType<AIStationList &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIStationList *)instance; }
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
     7
	template <> const AIStationList *GetParam(ForceType<const AIStationList *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIStationList *)instance; }
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
     8
	template <> const AIStationList &GetParam(ForceType<const AIStationList &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIStationList *)instance; }
9673
ee4f133c84ec (svn r10612) [NoAI] -Add: allow a class as return value; pack the result in a SQ instance and it should work perfectly
truelight
parents: 9670
diff changeset
     9
	template <> int Return<AIStationList *>(HSQUIRRELVM vm, AIStationList *res) { HSQOBJECT instance; Squirrel::CreateClassInstanceVM(vm, "AIStationList", res, &instance); sq_pushobject(vm, instance); return 1; }
9636
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
    10
}; // namespace SQConvert
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
    11
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
    12
void SQAIStationListRegister(Squirrel *engine) {
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
    13
	DefSQClass <AIStationList> SQAIStationList("AIStationList");
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
    14
	SQAIStationList.PreRegister(engine, "AIAbstractList");
9670
820b77e19bb3 (svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents: 9645
diff changeset
    15
	SQAIStationList.AddConstructor<void (AIStationList::*)(AIStation::StationType type), 2>(engine, "xi");
9636
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
    16
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
    17
	SQAIStationList.DefSQStaticMethod(engine, &AIStationList::GetClassName, "GetClassName", 1, "x");
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
    18
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
    19
	SQAIStationList.PostRegister(engine);
1005ffccf641 (svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff changeset
    20
}
9645
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    21
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    22
namespace SQConvert {
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    23
	/* Allow AIVehicleStationList to be used as Squirrel parameter */
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    24
	template <> AIVehicleStationList *GetParam(ForceType<AIVehicleStationList *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIVehicleStationList *)instance; }
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    25
	template <> AIVehicleStationList &GetParam(ForceType<AIVehicleStationList &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleStationList *)instance; }
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    26
	template <> const AIVehicleStationList *GetParam(ForceType<const AIVehicleStationList *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIVehicleStationList *)instance; }
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    27
	template <> const AIVehicleStationList &GetParam(ForceType<const AIVehicleStationList &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleStationList *)instance; }
9673
ee4f133c84ec (svn r10612) [NoAI] -Add: allow a class as return value; pack the result in a SQ instance and it should work perfectly
truelight
parents: 9670
diff changeset
    28
	template <> int Return<AIVehicleStationList *>(HSQUIRRELVM vm, AIVehicleStationList *res) { HSQOBJECT instance; Squirrel::CreateClassInstanceVM(vm, "AIVehicleStationList", res, &instance); sq_pushobject(vm, instance); return 1; }
9645
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    29
}; // namespace SQConvert
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    30
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    31
void SQAIVehicleStationListRegister(Squirrel *engine) {
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    32
	DefSQClass <AIVehicleStationList> SQAIVehicleStationList("AIVehicleStationList");
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    33
	SQAIVehicleStationList.PreRegister(engine, "AIAbstractList");
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    34
	SQAIVehicleStationList.AddConstructor<void (AIVehicleStationList::*)(VehicleID vehicle_id), 2>(engine, "xi");
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    35
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    36
	SQAIVehicleStationList.DefSQStaticMethod(engine, &AIVehicleStationList::GetClassName, "GetClassName", 1, "x");
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    37
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    38
	SQAIVehicleStationList.PostRegister(engine);
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9636
diff changeset
    39
}