summaryrefslogtreecommitdiff
path: root/ecs/src/component/local.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-06-16 13:17:57 +0200
committerHampusM <hampus@hampusmat.com>2024-06-16 13:17:57 +0200
commitd50a2f6e63c25adf3b64652310c423717bd3966f (patch)
tree3edf4ee3d1eec93a52a8de4fdc5a7be5c487c711 /ecs/src/component/local.rs
parent69d90ece7f54996f0f51fc120a38d37717c5248e (diff)
refactor(ecs): add component ID struct
Diffstat (limited to 'ecs/src/component/local.rs')
-rw-r--r--ecs/src/component/local.rs10
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>())
}
}