src/ai/api/ai_marine.hpp.sq
author truebrain
Thu, 28 Feb 2008 01:11:23 +0000
branchnoai
changeset 9803 c86d5834fb11
parent 9741 53c1c5850e01
child 10094 e737405b06dd
permissions -rw-r--r--
(svn r12309) [NoAI] -Codechange: optimize a little bit (a very small little bit, but every bit counts :) ) (glx)
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
9741
53c1c5850e01 (svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents: 9737
diff changeset
    12
void SQAIMarine_Register(Squirrel *engine) {
9691
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");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9691
diff changeset
    23
	SQAIMarine.DefSQStaticMethod(engine, &AIMarine::BuildWaterDepot,  "BuildWaterDepot",  3, "xib");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9691
diff changeset
    24
	SQAIMarine.DefSQStaticMethod(engine, &AIMarine::BuildDock,        "BuildDock",        2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9691
diff changeset
    25
	SQAIMarine.DefSQStaticMethod(engine, &AIMarine::BuildBuoy,        "BuildBuoy",        2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9691
diff changeset
    26
	SQAIMarine.DefSQStaticMethod(engine, &AIMarine::BuildLock,        "BuildLock",        2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9691
diff changeset
    27
	SQAIMarine.DefSQStaticMethod(engine, &AIMarine::BuildCanal,       "BuildCanal",       2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9691
diff changeset
    28
	SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveWaterDepot, "RemoveWaterDepot", 2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9691
diff changeset
    29
	SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveDock,       "RemoveDock",       2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9691
diff changeset
    30
	SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveBuoy,       "RemoveBuoy",       2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9691
diff changeset
    31
	SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveLock,       "RemoveLock",       2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9691
diff changeset
    32
	SQAIMarine.DefSQStaticMethod(engine, &AIMarine::RemoveCanal,      "RemoveCanal",      2, "xi");
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff changeset
    33
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff changeset
    34
	SQAIMarine.PostRegister(engine);
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
diff changeset
    35
}