diff options
Diffstat (limited to 'ecs/src/system/stateful.rs')
-rw-r--r-- | ecs/src/system/stateful.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ecs/src/system/stateful.rs b/ecs/src/system/stateful.rs index 99b56c1..810a071 100644 --- a/ecs/src/system/stateful.rs +++ b/ecs/src/system/stateful.rs @@ -4,7 +4,7 @@ use std::panic::{RefUnwindSafe, UnwindSafe}; use seq_macro::seq; -use crate::component::{Component, Id as ComponentId}; +use crate::component::Component; use crate::lock::Lock; use crate::system::util::check_params_are_compatible; use crate::system::{ @@ -21,13 +21,14 @@ use crate::tuple::{ TakeOptionElementResult as TupleTakeOptionElementResult, WithOptionElements as TupleWithOptionElements, }; +use crate::uid::Uid; use crate::World; /// A stateful system. pub struct Stateful<Func> { func: Func, - local_components: HashMap<ComponentId, Lock<Box<dyn Component>>>, + local_components: HashMap<Uid, Lock<Box<dyn Component>>>, } macro_rules! impl_system { @@ -125,7 +126,7 @@ macro_rules! impl_system { ) -> Option<ComponentRefMut<LocalComponent>> { let local_component = self.local_components - .get(&ComponentId::of::<LocalComponent>())? + .get(&LocalComponent::id())? .write_nonblock() .expect("Failed to aquire read-write local component lock"); @@ -139,7 +140,7 @@ macro_rules! impl_system { { self.local_components .insert( - ComponentId::of::<LocalComponent>(), + LocalComponent::id(), Lock::new(Box::new(local_component)) ); } |