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/event/component.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'ecs/src/event') diff --git a/ecs/src/event/component.rs b/ecs/src/event/component.rs index 40cd20d..8b066a7 100644 --- a/ecs/src/event/component.rs +++ b/ecs/src/event/component.rs @@ -5,7 +5,8 @@ use std::marker::PhantomData; use ecs_macros::Component; -use crate::component::{Component, Id as ComponentId}; +use crate::component::Component; +use crate::uid::Uid; use crate::event::{Event, Id}; use crate::tuple::{ReduceElement as TupleReduceElement, With as TupleWith}; @@ -50,7 +51,7 @@ where where Self: Sized, { - Id::new::, _>(Some(ComponentId::of::())) + Id::new::, _>(Some(ComponentT::id())) } } @@ -93,18 +94,18 @@ where where Self: Sized, { - Id::new::, _>(Some(ComponentId::of::())) + Id::new::, _>(Some(ComponentT::id())) } } #[must_use] -pub fn create_added_id(component_id: ComponentId) -> Id +pub fn create_added_id(component_id: Uid) -> Id { Id::new::, _>(Some(component_id)) } #[must_use] -pub fn create_removed_id(component_id: ComponentId) -> Id +pub fn create_removed_id(component_id: Uid) -> Id { Id::new::, _>(Some(component_id)) } -- cgit v1.2.3-18-g5258