MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / DefSQMethod

Method DefSQMethod

src/script/squirrel_class.hpp:36–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 */
35 template <typename Func>
36 void DefSQMethod(Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params = {})
37 {
38 using namespace SQConvert;
39 engine.AddMethod(function_name, DefSQNonStaticCallback<CL, Func, ST>, params, &function_proc, sizeof(function_proc));
40 }
41
42 /**
43 * This defines a method inside a class for Squirrel, which has access to the 'engine' (experts only!).

Callers

nothing calls this directly

Calls 1

AddMethodMethod · 0.80

Tested by

no test coverage detected