author | truebrain |
Tue, 27 May 2008 09:52:05 +0000 | |
branch | noai |
changeset 10734 | 06f95974ac15 |
parent 10722 | 6ea1daff57aa |
child 11058 | 3305a425f55b |
permissions | -rw-r--r-- |
10212
1e0a2a182253
(svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents:
9741
diff
changeset
|
1 |
/* $Id$ */ |
1e0a2a182253
(svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents:
9741
diff
changeset
|
2 |
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */ |
1e0a2a182253
(svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents:
9741
diff
changeset
|
3 |
|
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
4 |
#include "ai_list.hpp" |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
5 |
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
6 |
namespace SQConvert { |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
7 |
/* Allow AIList to be used as Squirrel parameter */ |
10734
06f95974ac15
(svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents:
10722
diff
changeset
|
8 |
template <> AIList *GetParam(ForceType<AIList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIList *)instance; } |
06f95974ac15
(svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents:
10722
diff
changeset
|
9 |
template <> AIList &GetParam(ForceType<AIList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIList *)instance; } |
06f95974ac15
(svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents:
10722
diff
changeset
|
10 |
template <> const AIList *GetParam(ForceType<const AIList *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIList *)instance; } |
06f95974ac15
(svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents:
10722
diff
changeset
|
11 |
template <> const AIList &GetParam(ForceType<const AIList &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIList *)instance; } |
9680
5ed7bbfd51c7
(svn r10629) [NoAI] -Fix: on returning a class instance which is NULL, do not make a wrapper SQ, but return a NULL pointer too
truelight
parents:
9679
diff
changeset
|
12 |
template <> int Return<AIList *>(HSQUIRRELVM vm, AIList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIList", res, NULL, DefSQDestructorCallback<AIList>); return 1; } |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
13 |
}; // namespace SQConvert |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
14 |
|
9741
53c1c5850e01
(svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents:
9680
diff
changeset
|
15 |
void SQAIList_Register(Squirrel *engine) { |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
16 |
DefSQClass <AIList> SQAIList("AIList"); |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
17 |
SQAIList.PreRegister(engine, "AIAbstractList"); |
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
|
18 |
SQAIList.AddConstructor<void (AIList::*)(), 1>(engine, "x"); |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
19 |
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
20 |
SQAIList.DefSQStaticMethod(engine, &AIList::GetClassName, "GetClassName", 1, "x"); |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
21 |
|
9664
c5741021bf59
(svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents:
9635
diff
changeset
|
22 |
SQAIList.DefSQMethod(engine, &AIList::AddItem, "AddItem", 3, "xii"); |
c5741021bf59
(svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents:
9635
diff
changeset
|
23 |
SQAIList.DefSQMethod(engine, &AIList::ChangeItem, "ChangeItem", 3, "xii"); |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
24 |
SQAIList.DefSQMethod(engine, &AIList::RemoveItem, "RemoveItem", 2, "xi"); |
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 |
SQAIList.PostRegister(engine); |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
27 |
} |