summaryrefslogtreecommitdiff
path: root/ecs/src/component/storage.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/src/component/storage.rs')
-rw-r--r--ecs/src/component/storage.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/ecs/src/component/storage.rs b/ecs/src/component/storage.rs
index a8711c5..d974967 100644
--- a/ecs/src/component/storage.rs
+++ b/ecs/src/component/storage.rs
@@ -339,7 +339,8 @@ impl Storage
.remove_entity(entity_uid)
.expect("Entity should exist in archetype");
- entity.remove_component(component_id, archetype_node.archetype());
+ let removed_component =
+ entity.remove_component(component_id, archetype_node.archetype());
self.graph
.get_node_by_id_mut(remove_edge_id)
@@ -350,6 +351,13 @@ impl Storage
self.entity_archetype_lookup
.insert(entity_uid, remove_edge_id);
+ tracing::debug!(
+ entity_id = %entity_uid,
+ component_id = %component_id,
+ component_name = removed_component.name(),
+ "Removed component from entity"
+ );
+
Ok(())
}
@@ -757,8 +765,8 @@ struct ImaginaryArchetype
#[cfg(test)]
mod tests
{
- use crate::component::storage::archetype::Id as ArchetypeId;
use crate::component::storage::Storage;
+ use crate::component::storage::archetype::Id as ArchetypeId;
use crate::uid::{Kind as UidKind, Uid};
#[test]