From daf0bc236df25c0e9f44bc3e30839c16cda3f638 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 11 Nov 2024 00:11:22 +0100 Subject: refactor(ecs): use same ID for entities & components --- ecs/src/component/local.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ecs/src/component/local.rs') 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::() else { + let Some(other_id) = other_comparable.downcast_ref::() else { return true; }; - Id::of::() != *other_id + LocalComponent::id() != *other_id } fn get_comparable() -> Box { - Box::new(Id::of::()) + Box::new(LocalComponent::id()) } } -- cgit v1.2.3-18-g5258