diff options
Diffstat (limited to 'engine-ecs/src/actions.rs')
| -rw-r--r-- | engine-ecs/src/actions.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/engine-ecs/src/actions.rs b/engine-ecs/src/actions.rs index 3d8afe6..efef384 100644 --- a/engine-ecs/src/actions.rs +++ b/engine-ecs/src/actions.rs @@ -2,7 +2,7 @@ use crate::component::{Parts as ComponentParts, Sequence as ComponentSequence}; use crate::event::component::Removed; use crate::pair::Pair; use crate::system::{Metadata as SystemMetadata, Param as SystemParam}; -use crate::uid::{Kind as UidKind, Uid, WithUidTuple}; +use crate::uid::{Uid, WithUidTuple}; use crate::{ActionQueue, World}; /// Used to to queue up actions for a [`World`] to perform. @@ -19,7 +19,7 @@ impl Actions<'_> /// that the entity will have. pub fn spawn<Comps: ComponentSequence>(&mut self, components: Comps) -> Uid { - let new_entity_uid = Uid::new_unique(UidKind::Entity); + let new_entity_uid = Uid::new_unique(); self.action_queue.push(Action::Spawn( new_entity_uid, @@ -32,7 +32,7 @@ impl Actions<'_> /// Queues up despawning a entity at the end of the current tick. pub fn despawn(&mut self, entity_uid: Uid) { - debug_assert_eq!(entity_uid.kind(), UidKind::Entity); + debug_assert!(!entity_uid.is_pair()); let Some(world) = self.world else { self.action_queue.push(Action::Despawn(entity_uid)); @@ -46,7 +46,7 @@ impl Actions<'_> // TODO: Submit all events with a single function call to reduce overhead for comp_id in ent.component_ids() { - if comp_id.kind() == UidKind::Pair { + if comp_id.is_pair() { continue; } @@ -67,7 +67,7 @@ impl Actions<'_> where Comps: ComponentSequence, { - debug_assert_eq!(entity_uid.kind(), UidKind::Entity); + debug_assert!(!entity_uid.is_pair()); if Comps::COUNT == 0 { return; @@ -87,7 +87,7 @@ impl Actions<'_> component_ids: impl IntoIterator<Item = Uid>, ) { - debug_assert_eq!(entity_uid.kind(), UidKind::Entity); + debug_assert!(!entity_uid.is_pair()); let mut component_ids = component_ids.into_iter().peekable(); @@ -118,7 +118,7 @@ impl Actions<'_> // TODO: Submit all events with a single function call to reduce overhead for comp_id in &component_ids { - if comp_id.kind() == UidKind::Pair { + if comp_id.is_pair() { continue; } |
