12 #ifndef SQUIRREL_CLASS_HPP 13 #define SQUIRREL_CLASS_HPP 21 template <
class CL, ScriptType ST>
24 const char *classname;
34 template <
typename Func>
38 engine->
AddMethod(function_name, DefSQNonStaticCallback<CL, Func, ST>, 0, NULL, &function_proc,
sizeof(function_proc));
44 template <
typename Func>
48 engine->
AddMethod(function_name, DefSQAdvancedNonStaticCallback<CL, Func, ST>, 0, NULL, &function_proc,
sizeof(function_proc));
57 template <
typename Func>
58 void DefSQMethod(
Squirrel *engine, Func function_proc,
const char *function_name,
int nparam,
const char *params)
61 engine->
AddMethod(function_name, DefSQNonStaticCallback<CL, Func, ST>, nparam, params, &function_proc,
sizeof(function_proc));
67 template <
typename Func>
71 engine->
AddMethod(function_name, DefSQStaticCallback<CL, Func>, 0, NULL, &function_proc,
sizeof(function_proc));
77 template <
typename Func>
81 engine->
AddMethod(function_name, DefSQAdvancedStaticCallback<CL, Func>, 0, NULL, &function_proc,
sizeof(function_proc));
90 template <
typename Func>
94 engine->
AddMethod(function_name, DefSQStaticCallback<CL, Func>, nparam, params, &function_proc,
sizeof(function_proc));
97 template <
typename Var>
98 void DefSQConst(
Squirrel *engine, Var value,
const char *var_name)
108 void PreRegister(
Squirrel *engine,
const char *parent_class)
113 template <
typename Func,
int Tnparam>
114 void AddConstructor(
Squirrel *engine,
const char *params)
117 engine->
AddMethod(
"constructor", DefSQConstructorCallback<CL, Func, Tnparam>, Tnparam, params);
120 void AddSQAdvancedConstructor(
Squirrel *engine)
123 engine->
AddMethod(
"constructor", DefSQAdvancedConstructorCallback<CL>, 0, NULL);
void AddMethod(const char *method_name, SQFUNCTION proc, uint nparam=0, const char *params=NULL, void *userdata=NULL, int size=0)
Adds a function to the stack.
The Squirrel convert routines.
void DefSQAdvancedStaticMethod(Squirrel *engine, Func function_proc, const char *function_name)
This defines a static method inside a class for Squirrel, which has access to the 'engine' (experts o...
declarations and parts of the implementation of the class for convert code
void DefSQMethod(Squirrel *engine, Func function_proc, const char *function_name, int nparam, const char *params)
This defines a method inside a class for Squirrel with defined params.
The template to define classes in Squirrel.
void DefSQMethod(Squirrel *engine, Func function_proc, const char *function_name)
This defines a method inside a class for Squirrel.
void DefSQStaticMethod(Squirrel *engine, Func function_proc, const char *function_name)
This defines a static method inside a class for Squirrel.
void AddConst(const char *var_name, int value)
Adds a const to the stack.
void DefSQAdvancedMethod(Squirrel *engine, Func function_proc, const char *function_name)
This defines a method inside a class for Squirrel, which has access to the 'engine' (experts only!)...
void AddClassBegin(const char *class_name)
Adds a class to the global scope.
void AddClassEnd()
Finishes adding a class to the global scope.
void DefSQStaticMethod(Squirrel *engine, Func function_proc, const char *function_name, int nparam, const char *params)
This defines a static method inside a class for Squirrel with defined params.