author | truelight |
Sun, 19 Aug 2007 13:31:04 +0000 | |
branch | noai |
changeset 9698 | 1d50fe99b7e9 |
parent 9691 | 1231d4e5f5aa |
child 9737 | ee408edf3851 |
permissions | -rw-r--r-- |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
1 |
#include "ai_marine.hpp" |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
2 |
|
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
3 |
namespace SQConvert { |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
4 |
/* Allow AIMarine to be used as Squirrel parameter */ |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
5 |
template <> AIMarine *GetParam(ForceType<AIMarine *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIMarine *)instance; } |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
6 |
template <> AIMarine &GetParam(ForceType<AIMarine &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIMarine *)instance; } |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
7 |
template <> const AIMarine *GetParam(ForceType<const AIMarine *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIMarine *)instance; } |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
8 |
template <> const AIMarine &GetParam(ForceType<const AIMarine &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIMarine *)instance; } |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
9 |
template <> int Return<AIMarine *>(HSQUIRRELVM vm, AIMarine *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIMarine", res, NULL, DefSQDestructorCallback<AIMarine>); return 1; } |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
10 |
}; // namespace SQConvert |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
11 |
|
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
12 |
void SQAIMarineRegister(Squirrel *engine) { |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
13 |
DefSQClass <AIMarine> SQAIMarine("AIMarine"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
14 |
SQAIMarine.PreRegister(engine); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
15 |
SQAIMarine.AddConstructor<void (AIMarine::*)(), 1>(engine, "x"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
16 |
|
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
17 |
SQAIMarine.DefSQStaticMethod(engine, &AIMarine::GetClassName, "GetClassName", 1, "x"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
18 |
SQAIMarine.DefSQStaticMethod(engine, &AIMarine::IsWaterDepotTile, "IsWaterDepotTile", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
19 |
SQAIMarine.DefSQStaticMethod(engine, &AIMarine::IsDockTile, "IsDockTile", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
20 |
SQAIMarine.DefSQStaticMethod(engine, &AIMarine::IsBuoyTile, "IsBuoyTile", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
21 |
SQAIMarine.DefSQStaticMethod(engine, &AIMarine::IsLockTile, "IsLockTile", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
22 |
SQAIMarine.DefSQStaticMethod(engine, &AIMarine::IsCanalTile, "IsCanalTile", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
23 |
|
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
24 |
SQAIMarine.DefSQMethod(engine, &AIMarine::BuildWaterDepot, "BuildWaterDepot", 3, "xib"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
25 |
SQAIMarine.DefSQMethod(engine, &AIMarine::BuildDock, "BuildDock", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
26 |
SQAIMarine.DefSQMethod(engine, &AIMarine::BuildBuoy, "BuildBuoy", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
27 |
SQAIMarine.DefSQMethod(engine, &AIMarine::BuildLock, "BuildLock", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
28 |
SQAIMarine.DefSQMethod(engine, &AIMarine::BuildCanal, "BuildCanal", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
29 |
SQAIMarine.DefSQMethod(engine, &AIMarine::RemoveWaterDepot, "RemoveWaterDepot", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
30 |
SQAIMarine.DefSQMethod(engine, &AIMarine::RemoveDock, "RemoveDock", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
31 |
SQAIMarine.DefSQMethod(engine, &AIMarine::RemoveBuoy, "RemoveBuoy", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
32 |
SQAIMarine.DefSQMethod(engine, &AIMarine::RemoveLock, "RemoveLock", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
33 |
SQAIMarine.DefSQMethod(engine, &AIMarine::RemoveCanal, "RemoveCanal", 2, "xi"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
34 |
|
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
35 |
SQAIMarine.PostRegister(engine); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff
changeset
|
36 |
} |