diff options
author | HampusM <hampus@hampusmat.com> | 2025-08-06 14:14:58 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-08-06 14:14:58 +0200 |
commit | 2d1cf05abb72699d38a7c7db7e131922252e1fc1 (patch) | |
tree | 98158913fa3d1482358a21426bcbbf4312afe02f /ecs/src/component.rs | |
parent | 43cbd47900d23801c584def1b7877fdea700c23a (diff) |
revert(ecs): make component removals not queryable
This reverts commit 43cbd47900d23801c584def1b7877fdea700c23a.
Diffstat (limited to 'ecs/src/component.rs')
-rw-r--r-- | ecs/src/component.rs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/ecs/src/component.rs b/ecs/src/component.rs index 5a8cd0b..6fb1230 100644 --- a/ecs/src/component.rs +++ b/ecs/src/component.rs @@ -2,8 +2,6 @@ use std::any::{type_name, Any}; use std::fmt::Debug; use std::ops::{Deref, DerefMut}; -use ecs_macros::Component; -use hashbrown::HashSet; use seq_macro::seq; use crate::lock::{ @@ -313,38 +311,3 @@ impl Default for PartsBuilder Self { name: "(unspecified)" } } } - -/// Pending component removals for a entity. -#[derive(Debug, Clone, Component)] -pub struct Removals -{ - component_ids: HashSet<Uid>, -} - -impl Removals -{ - pub fn contains<ComponentT: Component>(&self) -> bool - { - self.contains_id(ComponentT::id()) - } - - pub fn contains_id(&self, component_id: Uid) -> bool - { - self.component_ids.contains(&component_id) - } - - pub(crate) fn add_ids(&mut self, ids: impl IntoIterator<Item = Uid>) - { - self.component_ids.extend(ids) - } -} - -impl FromIterator<Uid> for Removals -{ - fn from_iter<T: IntoIterator<Item = Uid>>(iter: T) -> Self - { - Self { - component_ids: iter.into_iter().collect(), - } - } -} |