diff options
| author | HampusM <hampus@hampusmat.com> | 2026-11-29 21:16:11 +0100 |
|---|---|---|
| committer | HampusM <hampus@hampusmat.com> | 2026-11-29 21:16:11 +0100 |
| commit | 3c117bcd9455ffbcec5cd59dab37db0786e15e02 (patch) | |
| tree | 0355ba259b51b3d5c9eb7c74cf395461517231fa /engine-ecs/src/component/storage.rs | |
| parent | c416eca3cccac2c25ee395469005faca01fdb912 (diff) | |
feat(engine-ecs): change meaning of component name to type identifier
Diffstat (limited to 'engine-ecs/src/component/storage.rs')
| -rw-r--r-- | engine-ecs/src/component/storage.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/engine-ecs/src/component/storage.rs b/engine-ecs/src/component/storage.rs index 98f8d46..7a49110 100644 --- a/engine-ecs/src/component/storage.rs +++ b/engine-ecs/src/component/storage.rs @@ -261,7 +261,7 @@ impl Storage pub fn add_entity_component( &mut self, entity_uid: Uid, - (component_id, component_name, component): (Uid, &'static str, Box<dyn Any>), + (component_id, component): (Uid, Box<dyn Any>), ) -> Result<(), Error> { let Some(archetype_id) = self.entity_archetype_lookup.get(&entity_uid) else { @@ -334,7 +334,7 @@ impl Storage entity.insert_component( component_id, - ArchetypeEntityComponent::new(component, component_name), + ArchetypeEntityComponent::new(component), add_edge_archetype, ); @@ -403,8 +403,7 @@ impl Storage .remove_entity(entity_uid) .expect("Entity should exist in archetype"); - let removed_component = - entity.remove_component(component_id, archetype_node.archetype()); + entity.remove_component(component_id, archetype_node.archetype()); self.graph .get_node_by_id_mut(remove_edge_id) @@ -418,7 +417,6 @@ impl Storage tracing::debug!( entity_id = %entity_uid, component_id = %component_id, - component_name = removed_component.name(), "Removed component from entity" ); |
