From d50a2f6e63c25adf3b64652310c423717bd3966f Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 16 Jun 2024 13:17:57 +0200 Subject: refactor(ecs): add component ID struct --- ecs/src/system/stateful.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ecs/src/system') diff --git a/ecs/src/system/stateful.rs b/ecs/src/system/stateful.rs index b765ff0..ae6a5b5 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; +use crate::component::{Component, Id as ComponentId}; use crate::lock::Lock; use crate::system::util::check_params_are_compatible; use crate::system::{ @@ -27,7 +27,7 @@ use crate::WorldData; pub struct Stateful { func: Func, - local_components: HashMap>>, + local_components: HashMap>>, } macro_rules! impl_system { @@ -134,7 +134,7 @@ macro_rules! impl_system { ) -> Option> { let local_component = self.local_components - .get(&TypeId::of::())? + .get(&ComponentId::of::())? .write_nonblock() .expect("Failed to aquire read-write local component lock"); @@ -148,7 +148,7 @@ macro_rules! impl_system { { self.local_components .insert( - TypeId::of::(), + ComponentId::of::(), Lock::new(Box::new(local_component)) ); } -- cgit v1.2.3-18-g5258