summaryrefslogtreecommitdiff
path: root/ecs/src/component/local.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-11-11 00:11:22 +0100
committerHampusM <hampus@hampusmat.com>2024-11-11 00:11:22 +0100
commitdaf0bc236df25c0e9f44bc3e30839c16cda3f638 (patch)
tree7475e4e58686dd34366e641ec32f5a9374d66533 /ecs/src/component/local.rs
parent17f63d9859e1c82a30c07bf110cf2b9872e2427e (diff)
refactor(ecs): use same ID for entities & components
Diffstat (limited to 'ecs/src/component/local.rs')
-rw-r--r--ecs/src/component/local.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/ecs/src/component/local.rs b/ecs/src/component/local.rs
index a365efe..9d32d47 100644
--- a/ecs/src/component/local.rs
+++ b/ecs/src/component/local.rs
@@ -1,7 +1,8 @@
use std::any::Any;
use std::ops::{Deref, DerefMut};
-use crate::component::{Component, Id};
+use crate::component::Component;
+use crate::uid::Uid;
use crate::system::{ComponentRefMut, Param as SystemParam, System};
use crate::World;
@@ -43,16 +44,16 @@ where
{
let other_comparable = Other::get_comparable();
- let Some(other_id) = other_comparable.downcast_ref::<Id>() else {
+ let Some(other_id) = other_comparable.downcast_ref::<Uid>() else {
return true;
};
- Id::of::<LocalComponent>() != *other_id
+ LocalComponent::id() != *other_id
}
fn get_comparable() -> Box<dyn Any>
{
- Box::new(Id::of::<LocalComponent>())
+ Box::new(LocalComponent::id())
}
}