author | truelight |
Sat, 14 Jul 2007 21:15:49 +0000 | |
branch | noai |
changeset 9657 | f2c6e332d8bc |
parent 9645 | 25126afa0c25 |
child 9670 | 820b77e19bb3 |
permissions | -rw-r--r-- |
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 enums to be used as Squirrel parameters */ |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
5 |
template <> AIStationList::StationType GetParam(ForceType<AIStationList::StationType>, HSQUIRRELVM vm, int index) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIStationList::StationType)tmp; } |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
6 |
template <> int Return<AIStationList::StationType>(HSQUIRRELVM vm, AIStationList::StationType res) { sq_pushinteger(vm, (int32)res); return 1; } |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
7 |
|
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
8 |
/* 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
|
9 |
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
|
10 |
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
|
11 |
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
|
12 |
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
|
13 |
}; // namespace SQConvert |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
14 |
|
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
15 |
void SQAIStationListRegister(Squirrel *engine) { |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
16 |
DefSQClass <AIStationList> SQAIStationList("AIStationList"); |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
17 |
SQAIStationList.PreRegister(engine, "AIAbstractList"); |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
18 |
SQAIStationList.AddConstructor<void (AIStationList::*)(AIStationList::StationType type), 2>(engine, "xi"); |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
19 |
|
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
20 |
SQAIStationList.DefSQConst(engine, AIStationList::STATION_ANY, "STATION_ANY"); |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
21 |
SQAIStationList.DefSQConst(engine, AIStationList::STATION_TRAIN, "STATION_TRAIN"); |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
22 |
SQAIStationList.DefSQConst(engine, AIStationList::STATION_TRUCK_STOP, "STATION_TRUCK_STOP"); |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
23 |
SQAIStationList.DefSQConst(engine, AIStationList::STATION_BUS_STOP, "STATION_BUS_STOP"); |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
24 |
SQAIStationList.DefSQConst(engine, AIStationList::STATION_AIRPORT, "STATION_AIRPORT"); |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
25 |
SQAIStationList.DefSQConst(engine, AIStationList::STATION_DOCK, "STATION_DOCK"); |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
26 |
|
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
27 |
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
|
28 |
|
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
29 |
SQAIStationList.PostRegister(engine); |
1005ffccf641
(svn r10527) [NoAI] -Add: AIStationList(), which lists all your stations; useful to maintain routes
truelight
parents:
diff
changeset
|
30 |
} |
9645
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9636
diff
changeset
|
31 |
|
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9636
diff
changeset
|
32 |
namespace SQConvert { |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9636
diff
changeset
|
33 |
/* 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
|
34 |
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
|
35 |
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
|
36 |
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
|
37 |
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
|
38 |
}; // namespace SQConvert |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9636
diff
changeset
|
39 |
|
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9636
diff
changeset
|
40 |
void SQAIVehicleStationListRegister(Squirrel *engine) { |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9636
diff
changeset
|
41 |
DefSQClass <AIVehicleStationList> SQAIVehicleStationList("AIVehicleStationList"); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9636
diff
changeset
|
42 |
SQAIVehicleStationList.PreRegister(engine, "AIAbstractList"); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9636
diff
changeset
|
43 |
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
|
44 |
|
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9636
diff
changeset
|
45 |
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
|
46 |
|
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9636
diff
changeset
|
47 |
SQAIVehicleStationList.PostRegister(engine); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9636
diff
changeset
|
48 |
} |