src/ai/api/ai_sign.hpp.sq
author truelight
Thu, 12 Jul 2007 15:04:26 +0000
branchnoai
changeset 9635 9ee82e091af7
parent 9610 5cebcd43a1ec
child 9673 ee4f133c84ec
permissions -rw-r--r--
(svn r10526) [NoAI] -Fix: a class with params for the constructor lost his instance when called from SQ (templates can be really useful ;))
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     1
#include "ai_sign.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 AISign 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 <> AISign *GetParam(ForceType<AISign *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AISign *)instance; }
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     6
	template <> AISign &GetParam(ForceType<AISign &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AISign *)instance; }
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     7
	template <> const AISign *GetParam(ForceType<const AISign *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AISign *)instance; }
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     8
	template <> const AISign &GetParam(ForceType<const AISign &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AISign *)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 SQAISignRegister(Squirrel *engine) {
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    12
	DefSQClass <AISign> SQAISign("AISign");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    13
	SQAISign.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: 9610
diff changeset
    14
	SQAISign.AddConstructor<void (AISign::*)(), 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
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    16
	SQAISign.DefSQStaticMethod(engine, &AISign::GetClassName, "GetClassName", 1, "x");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    17
	SQAISign.DefSQStaticMethod(engine, &AISign::IsValidSign,  "IsValidSign",  2, "xi");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    18
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    19
	SQAISign.DefSQMethod(engine, &AISign::GetMaxSignID, "GetMaxSignID", 1, "x");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    20
	SQAISign.DefSQMethod(engine, &AISign::GetSignCount, "GetSignCount", 1, "x");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    21
	SQAISign.DefSQMethod(engine, &AISign::GetText,      "GetText",      2, "xi");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    22
	SQAISign.DefSQMethod(engine, &AISign::GetLocation,  "GetLocation",  2, "xi");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    23
	SQAISign.DefSQMethod(engine, &AISign::RemoveSign,   "RemoveSign",   2, "xi");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    24
	SQAISign.DefSQMethod(engine, &AISign::BuildSign,    "BuildSign",    3, "xis");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    25
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    26
	SQAISign.PostRegister(engine);
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    27
}