author | truebrain |
Fri, 18 Jul 2008 10:15:16 +0000 | |
branch | noai |
changeset 11168 | 3842648184cd |
parent 10290 | 74e044af664d |
permissions | -rw-r--r-- |
9388
032008c3f6e3
(svn r9180) [NoAI] -Fix: copy/pasting can be nasty: wrong @file headers
truelight
parents:
9387
diff
changeset
|
1 |
/* $Id$ */ |
032008c3f6e3
(svn r9180) [NoAI] -Fix: copy/pasting can be nasty: wrong @file headers
truelight
parents:
9387
diff
changeset
|
2 |
|
032008c3f6e3
(svn r9180) [NoAI] -Fix: copy/pasting can be nasty: wrong @file headers
truelight
parents:
9387
diff
changeset
|
3 |
/** @file squirrel_class.cpp defines templates for converting C++ classes to Squirrel classes */ |
032008c3f6e3
(svn r9180) [NoAI] -Fix: copy/pasting can be nasty: wrong @file headers
truelight
parents:
9387
diff
changeset
|
4 |
|
9387
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
5 |
#ifndef SQUIRREL_CLASS_HPP |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
6 |
#define SQUIRREL_CLASS_HPP |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
7 |
|
9602
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
8 |
#if (__GNUC__ == 2) |
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
9 |
/* GCC 2.95 doesn't like to have SQConvert::DefSQStaticCallback inside a |
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
10 |
* template (it gives an internal error 373). Above that, it doesn't listen |
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
11 |
* to 'using namespace' inside a function of a template. So for GCC 2.95 we |
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
12 |
* do it in the global space to avoid compiler errors. */ |
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
13 |
using namespace SQConvert; |
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
14 |
#endif /* __GNUC__ == 2 */ |
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
15 |
|
9387
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
16 |
/** |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
17 |
* The template to define classes in Squirrel. It takes care of the creation |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
18 |
* and calling of such classes, to make the AI Layer cleaner while having a |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
19 |
* powerful script as possible AI language. |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
20 |
*/ |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
21 |
template <class CL> |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
22 |
class DefSQClass { |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
23 |
private: |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
24 |
const char *classname; |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
25 |
|
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
26 |
public: |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
27 |
DefSQClass(const char *_classname) : |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
28 |
classname(_classname) |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
29 |
{} |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
30 |
|
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
31 |
/** |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
32 |
* This defines a method inside a class for Squirrel. |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
33 |
*/ |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
34 |
template <typename Func> |
9530
5b93bc87cc5e
(svn r9451) [NoAI] -Add: allow static and non-static members for SQ
truelight
parents:
9525
diff
changeset
|
35 |
void DefSQMethod(Squirrel *engine, Func function_proc, const char *function_name) |
9387
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
36 |
{ |
9602
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
37 |
using namespace SQConvert; |
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
38 |
engine->AddMethod(function_name, DefSQNonStaticCallback<CL, Func>, 0, NULL, &function_proc, sizeof(function_proc)); |
9539
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
39 |
} |
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
40 |
|
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
41 |
/** |
9813
9646f7e37c31
(svn r12409) [NoAI] -Add: allow an AdvancedMethod which gives you complete control over the param handling from a call from SQ
truebrain
parents:
9635
diff
changeset
|
42 |
* This defines a method inside a class for Squirrel, which has access to the 'engine' (experts only!). |
9646f7e37c31
(svn r12409) [NoAI] -Add: allow an AdvancedMethod which gives you complete control over the param handling from a call from SQ
truebrain
parents:
9635
diff
changeset
|
43 |
*/ |
9646f7e37c31
(svn r12409) [NoAI] -Add: allow an AdvancedMethod which gives you complete control over the param handling from a call from SQ
truebrain
parents:
9635
diff
changeset
|
44 |
template <typename Func> |
9646f7e37c31
(svn r12409) [NoAI] -Add: allow an AdvancedMethod which gives you complete control over the param handling from a call from SQ
truebrain
parents:
9635
diff
changeset
|
45 |
void DefSQAdvancedMethod(Squirrel *engine, Func function_proc, const char *function_name) |
9646f7e37c31
(svn r12409) [NoAI] -Add: allow an AdvancedMethod which gives you complete control over the param handling from a call from SQ
truebrain
parents:
9635
diff
changeset
|
46 |
{ |
9646f7e37c31
(svn r12409) [NoAI] -Add: allow an AdvancedMethod which gives you complete control over the param handling from a call from SQ
truebrain
parents:
9635
diff
changeset
|
47 |
using namespace SQConvert; |
9646f7e37c31
(svn r12409) [NoAI] -Add: allow an AdvancedMethod which gives you complete control over the param handling from a call from SQ
truebrain
parents:
9635
diff
changeset
|
48 |
engine->AddMethod(function_name, DefSQAdvancedNonStaticCallback<CL, Func>, 0, NULL, &function_proc, sizeof(function_proc)); |
9646f7e37c31
(svn r12409) [NoAI] -Add: allow an AdvancedMethod which gives you complete control over the param handling from a call from SQ
truebrain
parents:
9635
diff
changeset
|
49 |
} |
9646f7e37c31
(svn r12409) [NoAI] -Add: allow an AdvancedMethod which gives you complete control over the param handling from a call from SQ
truebrain
parents:
9635
diff
changeset
|
50 |
|
9646f7e37c31
(svn r12409) [NoAI] -Add: allow an AdvancedMethod which gives you complete control over the param handling from a call from SQ
truebrain
parents:
9635
diff
changeset
|
51 |
/** |
10290
74e044af664d
(svn r12822) [NoAI] -Fix: minor documentation typo
truebrain
parents:
9813
diff
changeset
|
52 |
* This defines a method inside a class for Squirrel with defined params. |
9540
505fcc067ade
(svn r9462) [NoAI] -Add: add a note about defining params for functions (first param should always be a 'x')
truelight
parents:
9539
diff
changeset
|
53 |
* @note If you define nparam, make sure that he first param is always 'x', |
505fcc067ade
(svn r9462) [NoAI] -Add: add a note about defining params for functions (first param should always be a 'x')
truelight
parents:
9539
diff
changeset
|
54 |
* which is the 'this' inside the function. This is hidden from the rest |
505fcc067ade
(svn r9462) [NoAI] -Add: add a note about defining params for functions (first param should always be a 'x')
truelight
parents:
9539
diff
changeset
|
55 |
* of the code, but without it calling your function will fail! |
9539
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
56 |
*/ |
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
57 |
template <typename Func> |
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
58 |
void DefSQMethod(Squirrel *engine, Func function_proc, const char *function_name, int nparam, const char *params) |
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
59 |
{ |
9602
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
60 |
using namespace SQConvert; |
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
61 |
engine->AddMethod(function_name, DefSQNonStaticCallback<CL, Func>, nparam, params, &function_proc, sizeof(function_proc)); |
9530
5b93bc87cc5e
(svn r9451) [NoAI] -Add: allow static and non-static members for SQ
truelight
parents:
9525
diff
changeset
|
62 |
} |
5b93bc87cc5e
(svn r9451) [NoAI] -Add: allow static and non-static members for SQ
truelight
parents:
9525
diff
changeset
|
63 |
|
5b93bc87cc5e
(svn r9451) [NoAI] -Add: allow static and non-static members for SQ
truelight
parents:
9525
diff
changeset
|
64 |
/** |
5b93bc87cc5e
(svn r9451) [NoAI] -Add: allow static and non-static members for SQ
truelight
parents:
9525
diff
changeset
|
65 |
* This defines a static method inside a class for Squirrel. |
5b93bc87cc5e
(svn r9451) [NoAI] -Add: allow static and non-static members for SQ
truelight
parents:
9525
diff
changeset
|
66 |
*/ |
5b93bc87cc5e
(svn r9451) [NoAI] -Add: allow static and non-static members for SQ
truelight
parents:
9525
diff
changeset
|
67 |
template <typename Func> |
5b93bc87cc5e
(svn r9451) [NoAI] -Add: allow static and non-static members for SQ
truelight
parents:
9525
diff
changeset
|
68 |
void DefSQStaticMethod(Squirrel *engine, Func function_proc, const char *function_name) |
5b93bc87cc5e
(svn r9451) [NoAI] -Add: allow static and non-static members for SQ
truelight
parents:
9525
diff
changeset
|
69 |
{ |
9602
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
70 |
using namespace SQConvert; |
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
71 |
engine->AddMethod(function_name, DefSQStaticCallback<CL, Func>, 0, NULL, &function_proc, sizeof(function_proc)); |
9539
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
72 |
} |
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
73 |
|
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
74 |
/** |
10290
74e044af664d
(svn r12822) [NoAI] -Fix: minor documentation typo
truebrain
parents:
9813
diff
changeset
|
75 |
* This defines a static method inside a class for Squirrel with defined params. |
9540
505fcc067ade
(svn r9462) [NoAI] -Add: add a note about defining params for functions (first param should always be a 'x')
truelight
parents:
9539
diff
changeset
|
76 |
* @note If you define nparam, make sure that he first param is always 'x', |
505fcc067ade
(svn r9462) [NoAI] -Add: add a note about defining params for functions (first param should always be a 'x')
truelight
parents:
9539
diff
changeset
|
77 |
* which is the 'this' inside the function. This is hidden from the rest |
505fcc067ade
(svn r9462) [NoAI] -Add: add a note about defining params for functions (first param should always be a 'x')
truelight
parents:
9539
diff
changeset
|
78 |
* of the code, but without it calling your function will fail! |
9539
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
79 |
*/ |
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
80 |
template <typename Func> |
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
81 |
void DefSQStaticMethod(Squirrel *engine, Func function_proc, const char *function_name, int nparam, const char *params) |
7416d0694d3a
(svn r9461) [NoAI] -Add: allow to set the amount of params that SQ should expect in the SQ define lines. Script to automated this are coming up next.
truelight
parents:
9530
diff
changeset
|
82 |
{ |
9602
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
83 |
using namespace SQConvert; |
f9f8a5a15f60
(svn r9732) [NoAI] -Fix: GCC 2.95 doesn't like SQConvert::Bla inside a template. Use 'using namespace' to avoid. This re-enables MorphOS target for NoAI branch.
truelight
parents:
9588
diff
changeset
|
84 |
engine->AddMethod(function_name, DefSQStaticCallback<CL, Func>, nparam, params, &function_proc, sizeof(function_proc)); |
9387
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
85 |
} |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
86 |
|
9525
1d6c509b56ee
(svn r9445) [NoAI] -Change: changed from sq_createslot to sq_newslot (first is deprecated)
truelight
parents:
9424
diff
changeset
|
87 |
template <typename Var> |
1d6c509b56ee
(svn r9445) [NoAI] -Change: changed from sq_createslot to sq_newslot (first is deprecated)
truelight
parents:
9424
diff
changeset
|
88 |
void DefSQConst(Squirrel *engine, Var value, const char *var_name) |
1d6c509b56ee
(svn r9445) [NoAI] -Change: changed from sq_createslot to sq_newslot (first is deprecated)
truelight
parents:
9424
diff
changeset
|
89 |
{ |
1d6c509b56ee
(svn r9445) [NoAI] -Change: changed from sq_createslot to sq_newslot (first is deprecated)
truelight
parents:
9424
diff
changeset
|
90 |
engine->AddConst(var_name, value); |
1d6c509b56ee
(svn r9445) [NoAI] -Change: changed from sq_createslot to sq_newslot (first is deprecated)
truelight
parents:
9424
diff
changeset
|
91 |
} |
1d6c509b56ee
(svn r9445) [NoAI] -Change: changed from sq_createslot to sq_newslot (first is deprecated)
truelight
parents:
9424
diff
changeset
|
92 |
|
9422
33efcc5f1b09
(svn r9223) [NoAI] -Change: moved squirrel/engine.cpp to squirrel.cpp in root
truelight
parents:
9404
diff
changeset
|
93 |
void PreRegister(Squirrel *engine) |
9387
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
94 |
{ |
9396
a05857491d2d
(svn r9188) [NoAI] -Cleanup: cleaned up DefSQClass a bit by using the SquirrelEngine
truelight
parents:
9388
diff
changeset
|
95 |
engine->AddClassBegin(this->classname); |
9404
ef9e171617a3
(svn r9201) [NoAI] -Change: make adding a default-constructor for DefSQClass optional
truelight
parents:
9396
diff
changeset
|
96 |
} |
ef9e171617a3
(svn r9201) [NoAI] -Change: make adding a default-constructor for DefSQClass optional
truelight
parents:
9396
diff
changeset
|
97 |
|
9588
01b2435c977b
(svn r9618) [NoAI] -Add: allow an extra param for PreRegister to register classes as extends of others
truelight
parents:
9540
diff
changeset
|
98 |
void PreRegister(Squirrel *engine, const char *parent_class) |
01b2435c977b
(svn r9618) [NoAI] -Add: allow an extra param for PreRegister to register classes as extends of others
truelight
parents:
9540
diff
changeset
|
99 |
{ |
01b2435c977b
(svn r9618) [NoAI] -Add: allow an extra param for PreRegister to register classes as extends of others
truelight
parents:
9540
diff
changeset
|
100 |
engine->AddClassBegin(this->classname, parent_class); |
01b2435c977b
(svn r9618) [NoAI] -Add: allow an extra param for PreRegister to register classes as extends of others
truelight
parents:
9540
diff
changeset
|
101 |
} |
01b2435c977b
(svn r9618) [NoAI] -Add: allow an extra param for PreRegister to register classes as extends of others
truelight
parents:
9540
diff
changeset
|
102 |
|
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
|
103 |
template <typename Func, int Tnparam> |
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
|
104 |
void AddConstructor(Squirrel *engine, const char *params) |
9404
ef9e171617a3
(svn r9201) [NoAI] -Change: make adding a default-constructor for DefSQClass optional
truelight
parents:
9396
diff
changeset
|
105 |
{ |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9602
diff
changeset
|
106 |
using namespace SQConvert; |
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
|
107 |
engine->AddMethod("constructor", DefSQConstructorCallback<CL, Func, Tnparam>, Tnparam, params); |
9387
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
108 |
} |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
109 |
|
9422
33efcc5f1b09
(svn r9223) [NoAI] -Change: moved squirrel/engine.cpp to squirrel.cpp in root
truelight
parents:
9404
diff
changeset
|
110 |
void PostRegister(Squirrel *engine) |
9387
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
111 |
{ |
9396
a05857491d2d
(svn r9188) [NoAI] -Cleanup: cleaned up DefSQClass a bit by using the SquirrelEngine
truelight
parents:
9388
diff
changeset
|
112 |
engine->AddClassEnd(); |
9387
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
113 |
} |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
114 |
}; |
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
115 |
|
4255a0a2d272
(svn r9179) [NoAI] -Add: added templates that makes adding classes to squirrel very easy
truelight
parents:
diff
changeset
|
116 |
#endif /* SQUIRREL_CLASS_HPP */ |