| 162 | } |
| 163 | |
| 164 | Error 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 | |
| 181 | Error 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); |
nothing calls this directly
no test coverage detected