diff options
author | HampusM <hampus@hampusmat.com> | 2024-05-24 19:15:23 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-05-24 19:15:23 +0200 |
commit | 8af5413b0fd2b06f71098c1230f79b3e6beb037d (patch) | |
tree | e1a3000c19b4e568890b2a0d246334f8debfe0c8 /ecs/src/lib.rs | |
parent | b8417d20765755cfa2cecacb11c77e3abbafd546 (diff) |
feat(ecs): add component name to component locking panic message
Diffstat (limited to 'ecs/src/lib.rs')
-rw-r--r-- | ecs/src/lib.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs index fbcc451..0bc7aa6 100644 --- a/ecs/src/lib.rs +++ b/ecs/src/lib.rs @@ -48,6 +48,7 @@ struct Entity pub struct EntityComponent { pub id: TypeId, + pub name: &'static str, pub component: Lock<Box<dyn Component>>, pub drop_last: bool, } @@ -90,6 +91,7 @@ impl World ManuallyDrop::new(EntityComponent { id: (*component).type_id(), + name: component.type_name(), component: Lock::new(component), drop_last, }) @@ -187,6 +189,7 @@ impl World ManuallyDrop::new(EntityComponent { id: (*component).type_id(), + name: component.type_name(), component: Lock::new(component), drop_last, }) |