| 176 | } |
| 177 | |
| 178 | int buildModule2(asIScriptEngine* engine, asIScriptContext* /* ctx */) |
| 179 | { |
| 180 | asIScriptModule* mod = engine->GetModule("TestModule", asGM_ALWAYS_CREATE); |
| 181 | mod->AddScriptSection("test", |
| 182 | "class Main \n" |
| 183 | "{ \n" |
| 184 | " private string m_string; \n" |
| 185 | " private string[]@ m_array; \n" |
| 186 | " Main() \n" |
| 187 | " { \n" |
| 188 | " print('CTOR'); \n" |
| 189 | " m_string = 'Hello, world!'; \n" |
| 190 | " string aux = 'Goodbye, cruel world'; \n" |
| 191 | " string[] somearray; \n" |
| 192 | " somearray.insertLast(aux); \n" |
| 193 | " @m_array = @somearray; \n" |
| 194 | " print(m_array[0]); \n" |
| 195 | |
| 196 | " print('CTOR END'); \n" |
| 197 | " } \n" |
| 198 | " void Update() \n" |
| 199 | " { \n" |
| 200 | " print(m_string); \n" |
| 201 | " print(m_array[0]); \n" |
| 202 | " } \n" |
| 203 | "}; \n"); |
| 204 | int r = mod->Build(); |
| 205 | |
| 206 | return r; |
| 207 | } |
| 208 | |
| 209 | asIScriptObject* instantializeClass(bool initMembers, asIScriptEngine* engine, asIScriptContext* ctx) |
| 210 | { |
no test coverage detected