MCPcopy Create free account
hub / github.com/GodotECS/godex / create_shared_component

Method create_shared_component

world/world.cpp:166–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166godex::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
176void 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.");

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected