From 64eddc633cea0f4bc5603cc2d4c4c6eafac5c177 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 6 Feb 2025 13:38:46 +0100 Subject: refactor(ecs): rewrite component storage --- ecs/src/relationship.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ecs/src/relationship.rs') diff --git a/ecs/src/relationship.rs b/ecs/src/relationship.rs index 143b589..54dc0cd 100644 --- a/ecs/src/relationship.rs +++ b/ecs/src/relationship.rs @@ -174,14 +174,15 @@ where let archetype = self.component_storage_lock.get_entity_archetype(*target)?; let entity = archetype - .get_entity(*target) + .get_entity_by_id(*target) .expect("Target entity is gone from archetype"); let component_index = archetype.get_index_for_component(ComponentT::id())?; let component = ComponentRefMut::new( entity - .get_component(component_index)? + .components + .get(component_index)? .component .write_nonblock() .unwrap_or_else(|_| { @@ -430,14 +431,15 @@ where let archetype = self.component_storage_lock.get_entity_archetype(*target)?; let entity = archetype - .get_entity(*target) + .get_entity_by_id(*target) .expect("Target entity is gone from archetype"); let component_index = archetype.get_index_for_component(ComponentT::id())?; let component = ComponentRef::new( entity - .get_component(component_index)? + .components + .get(component_index)? .component .read_nonblock() .unwrap_or_else(|_| { -- cgit v1.2.3-18-g5258