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

Method get_state

modules/multiplayer/multiplayer_synchronizer.cpp:164–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164Error MultiplayerSynchronizer::get_state(const List<NodePath> &p_properties, Object *p_obj, Vector<Variant> &r_variant, Vector<const Variant *> &r_variant_ptrs) {
165 ERR_FAIL_NULL_V(p_obj, ERR_INVALID_PARAMETER);
166 r_variant.resize(p_properties.size());
167 r_variant_ptrs.resize(r_variant.size());
168 int i = 0;
169 for (const NodePath &prop : p_properties) {
170 bool valid = false;
171 const Object *obj = _get_prop_target(p_obj, prop);
172 ERR_FAIL_NULL_V(obj, FAILED);
173 r_variant.write[i] = obj->get_indexed(prop.get_subnames(), &valid);
174 r_variant_ptrs.write[i] = &r_variant[i];
175 ERR_FAIL_COND_V_MSG(!valid, ERR_INVALID_DATA, vformat("Property '%s' not found.", prop));
176 i++;
177 }
178 return OK;
179}
180
181Error MultiplayerSynchronizer::set_state(const List<NodePath> &p_properties, Object *p_obj, const Vector<Variant> &p_state) {
182 ERR_FAIL_NULL_V(p_obj, ERR_INVALID_PARAMETER);

Callers

nothing calls this directly

Calls 5

vformatFunction · 0.85
get_indexedMethod · 0.80
get_subnamesMethod · 0.80
sizeMethod · 0.65
resizeMethod · 0.45

Tested by

no test coverage detected