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/component/local.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ecs/src/component/local.rs') 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::() else { + let Some(other_id) = other_comparable.downcast_ref::() else { return true; }; - TypeId::of::() != *other_type_id + Id::of::() != *other_id } fn get_comparable() -> Box { - Box::new(TypeId::of::()) + Box::new(Id::of::()) } } -- cgit v1.2.3-18-g5258