MCPcopy Create free account
hub / github.com/anjo76/angelscript / buildModule

Function buildModule

sdk/tests/test_feature/source/test_addon_serializer.cpp:150–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148};
149
150int buildModule(asIScriptEngine* engine, asIScriptContext* /* ctx */)
151{
152 asIScriptModule *mod = engine->GetModule("TestModule", asGM_ALWAYS_CREATE);
153 mod->AddScriptSection("test",
154 "class Main \n"
155 "{ \n"
156 " private string m_string; \n"
157 " private CppObj@ m_obj; \n"
158 " Main() \n"
159 " { \n"
160 " m_string = 'Hello, '; \n"
161
162 " CppObj aux; \n"
163 " aux.setStr('world!'); \n"
164
165 " @m_obj = @aux; \n"
166 " } \n"
167 " void Update() \n"
168 " { \n"
169 " print(m_string); \n"
170 " print(m_obj.str()); \n"
171 " } \n"
172 "}; \n");
173 int r = mod->Build();
174
175 return r;
176}
177
178int buildModule2(asIScriptEngine* engine, asIScriptContext* /* ctx */)
179{

Callers 1

Calls 3

AddScriptSectionMethod · 0.80
GetModuleMethod · 0.45
BuildMethod · 0.45

Tested by

no test coverage detected