diff options
author | HampusM <hampus@hampusmat.com> | 2024-06-16 13:17:57 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-06-16 13:17:57 +0200 |
commit | d50a2f6e63c25adf3b64652310c423717bd3966f (patch) | |
tree | 3edf4ee3d1eec93a52a8de4fdc5a7be5c487c711 /ecs/src/component/local.rs | |
parent | 69d90ece7f54996f0f51fc120a38d37717c5248e (diff) |
refactor(ecs): add component ID struct
Diffstat (limited to 'ecs/src/component/local.rs')
-rw-r--r-- | ecs/src/component/local.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ecs/src/component/local.rs b/ecs/src/component/local.rs index e1a0c1f..89c3139 100644 --- a/ecs/src/component/local.rs +++ b/ecs/src/component/local.rs @@ -1,7 +1,7 @@ -use std::any::{Any, TypeId}; +use std::any::Any; use std::ops::{Deref, DerefMut}; -use crate::component::Component; +use crate::component::{Component, Id}; use crate::system::{ComponentRefMut, Param as SystemParam, System}; use crate::WorldData; @@ -43,16 +43,16 @@ where { let other_comparable = Other::get_comparable(); - let Some(other_type_id) = other_comparable.downcast_ref::<TypeId>() else { + let Some(other_id) = other_comparable.downcast_ref::<Id>() else { return true; }; - TypeId::of::<LocalComponent>() != *other_type_id + Id::of::<LocalComponent>() != *other_id } fn get_comparable() -> Box<dyn Any> { - Box::new(TypeId::of::<LocalComponent>()) + Box::new(Id::of::<LocalComponent>()) } } |