src/squirrel_class.hpp
branchnoai
changeset 9813 9646f7e37c31
parent 9635 9ee82e091af7
child 10290 74e044af664d
equal deleted inserted replaced
9812:4bc3062476c8 9813:9646f7e37c31
    34 	template <typename Func>
    34 	template <typename Func>
    35 	void DefSQMethod(Squirrel *engine, Func function_proc, const char *function_name)
    35 	void DefSQMethod(Squirrel *engine, Func function_proc, const char *function_name)
    36 	{
    36 	{
    37 		using namespace SQConvert;
    37 		using namespace SQConvert;
    38 		engine->AddMethod(function_name, DefSQNonStaticCallback<CL, Func>, 0, NULL, &function_proc, sizeof(function_proc));
    38 		engine->AddMethod(function_name, DefSQNonStaticCallback<CL, Func>, 0, NULL, &function_proc, sizeof(function_proc));
       
    39 	}
       
    40 
       
    41 	/**
       
    42 	 * This defines a method inside a class for Squirrel, which has access to the 'engine' (experts only!).
       
    43 	 */
       
    44 	template <typename Func>
       
    45 	void DefSQAdvancedMethod(Squirrel *engine, Func function_proc, const char *function_name)
       
    46 	{
       
    47 		using namespace SQConvert;
       
    48 		engine->AddMethod(function_name, DefSQAdvancedNonStaticCallback<CL, Func>, 0, NULL, &function_proc, sizeof(function_proc));
    39 	}
    49 	}
    40 
    50 
    41 	/**
    51 	/**
    42 	 * This defines a method inside a class for Squirrel with defined the params.
    52 	 * This defines a method inside a class for Squirrel with defined the params.
    43 	 * @note If you define nparam, make sure that he first param is always 'x',
    53 	 * @note If you define nparam, make sure that he first param is always 'x',