| 164 | } |
| 165 | |
| 166 | godex::SID World::create_shared_component(uint32_t p_component_id, const Dictionary &p_component_data) { |
| 167 | ERR_FAIL_COND_V_MSG(ECS::is_component_sharable(p_component_id) == false, godex::SID_NONE, "The component " + ECS::get_component_name(p_component_id) + " is not shareable."); |
| 168 | create_storage(p_component_id); |
| 169 | |
| 170 | SharedStorageBase *storage = get_shared_storage(p_component_id); |
| 171 | ERR_FAIL_COND_V_MSG(storage == nullptr, godex::SID_NONE, "The storage is not supposed to be `nullptr` at this point."); |
| 172 | |
| 173 | return storage->create_shared_component_dynamic(p_component_data); |
| 174 | } |
| 175 | |
| 176 | void World::add_shared_component(EntityID p_entity, uint32_t p_component_id, godex::SID p_shared_component_id) { |
| 177 | ERR_FAIL_COND_MSG(ECS::is_component_sharable(p_component_id) == false, "The component " + ECS::get_component_name(p_component_id) + " is not shareable."); |
nothing calls this directly
no test coverage detected