MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Populate

Method Populate

Source/Scripting/angelscript/asmodule.cpp:452–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450void FillVar(VarStorage& new_var, const char* name, int type_id, void* ptr, std::list<ScriptObjectInstance>& handle_var_list, asIScriptModule* module);
451
452void ScriptObject::Populate(asIScriptObject* obj, std::list<ScriptObjectInstance>& handle_var_list, asIScriptModule* module) {
453 int c = obj->GetPropertyCount();
454 for (int n = 0; n < c; n++) {
455 const char* name = obj->GetPropertyName(n);
456 int type_id = obj->GetPropertyTypeId(n);
457 void* ptr = obj->GetAddressOfProperty(n);
458 VarStorage new_var;
459 FillVar(new_var, name, type_id, ptr, handle_var_list, module);
460 storage.push_back(new_var);
461 }
462}
463
464void ScriptObject::destroy() {
465 std::list<VarStorage>::iterator iter = storage.begin();

Callers 1

FillVarFunction · 0.80

Calls 6

FillVarFunction · 0.85
GetPropertyNameMethod · 0.80
GetPropertyTypeIdMethod · 0.80
GetAddressOfPropertyMethod · 0.80
GetPropertyCountMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected