10 #ifndef SQUIRREL_CLASS_HPP
11 #define SQUIRREL_CLASS_HPP
19 template <
class CL, ScriptType ST>
22 const char *classname;
32 template <
typename Func>
36 engine->
AddMethod(function_name, DefSQNonStaticCallback<CL, Func, ST>, 0,
nullptr, &function_proc,
sizeof(function_proc));
42 template <
typename Func>
46 engine->
AddMethod(function_name, DefSQAdvancedNonStaticCallback<CL, Func, ST>, 0,
nullptr, &function_proc,
sizeof(function_proc));
55 template <
typename Func>
56 void DefSQMethod(
Squirrel *engine, Func function_proc,
const char *function_name,
int nparam,
const char *params)
59 engine->
AddMethod(function_name, DefSQNonStaticCallback<CL, Func, ST>, nparam, params, &function_proc,
sizeof(function_proc));
65 template <
typename Func>
69 engine->
AddMethod(function_name, DefSQStaticCallback<CL, Func>, 0,
nullptr, &function_proc,
sizeof(function_proc));
75 template <
typename Func>
79 engine->
AddMethod(function_name, DefSQAdvancedStaticCallback<CL, Func>, 0,
nullptr, &function_proc,
sizeof(function_proc));
88 template <
typename Func>
92 engine->
AddMethod(function_name, DefSQStaticCallback<CL, Func>, nparam, params, &function_proc,
sizeof(function_proc));
95 template <
typename Var>
96 void DefSQConst(
Squirrel *engine, Var value,
const char *var_name)
106 void PreRegister(
Squirrel *engine,
const char *parent_class)
111 template <
typename Func,
int Tnparam>
112 void AddConstructor(
Squirrel *engine,
const char *params)
115 engine->
AddMethod(
"constructor", DefSQConstructorCallback<CL, Func, Tnparam>, Tnparam, params);
118 void AddSQAdvancedConstructor(
Squirrel *engine)
121 engine->
AddMethod(
"constructor", DefSQAdvancedConstructorCallback<CL>, 0,
nullptr);