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

Method DefSQStaticMethod

src/script/squirrel_class.hpp:59–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 */
58 template <typename Func>
59 void DefSQStaticMethod(Squirrel &engine, Func function_proc, std::string_view function_name, std::string_view params = {})
60 {
61 using namespace SQConvert;
62 engine.AddMethod(function_name, DefSQStaticCallback<CL, Func>, params, &function_proc, sizeof(function_proc));
63 }
64
65 /**
66 * This defines a static method inside a class for Squirrel, which has access to the 'engine' (experts only!).

Callers 2

SQGSController_RegisterFunction · 0.80
SQAIController_RegisterFunction · 0.80

Calls 1

AddMethodMethod · 0.80

Tested by

no test coverage detected