MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / reload_members

Method reload_members

modules/gdscript/gdscript.cpp:2151–2177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2149}
2150
2151void GDScriptInstance::reload_members() {
2152#ifdef DEBUG_ENABLED
2153
2154 Vector<Variant> new_members;
2155 new_members.resize(script->member_indices.size());
2156
2157 //pass the values to the new indices
2158 for (KeyValue<StringName, GDScript::MemberInfo> &E : script->member_indices) {
2159 if (member_indices_cache.has(E.key)) {
2160 Variant value = members[member_indices_cache[E.key]];
2161 new_members.write[E.value.index] = value;
2162 }
2163 }
2164
2165 members.resize(new_members.size()); //resize
2166
2167 //apply
2168 members = new_members;
2169
2170 //pass the values to the new indices
2171 member_indices_cache.clear();
2172 for (const KeyValue<StringName, GDScript::MemberInfo> &E : script->member_indices) {
2173 member_indices_cache[E.key] = E.value.index;
2174 }
2175
2176#endif
2177}
2178
2179GDScriptInstance::GDScriptInstance() {
2180 owner = nullptr;

Callers 1

_compile_classMethod · 0.80

Calls 4

sizeMethod · 0.65
resizeMethod · 0.45
hasMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected