diff options
author | HampusM <hampus@hampusmat.com> | 2025-10-13 18:50:30 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-10-13 18:50:30 +0200 |
commit | cb1197a132f87cd5034bb8927fdbd09878d9239a (patch) | |
tree | ac234c3d659f06f99e0945a88b73cae28fc4bf59 /ecs/src/actions.rs | |
parent | d1cf80806c3be68d4a96faefbad4e4cdc0a7832e (diff) |
Diffstat (limited to 'ecs/src/actions.rs')
-rw-r--r-- | ecs/src/actions.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ecs/src/actions.rs b/ecs/src/actions.rs index f8a59fa..549e341 100644 --- a/ecs/src/actions.rs +++ b/ecs/src/actions.rs @@ -6,7 +6,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}; +use crate::uid::{Kind as UidKind, Uid, WithUidTuple}; use crate::{ActionQueue, World}; /// Used to to queue up actions for a [`World`] to perform. @@ -139,6 +139,12 @@ impl Actions<'_> .push(Action::RemoveComponents(entity_uid, component_ids)); } + /// Queues up removing component(s) from a entity at the end of the current tick. + pub fn remove_comps<Ids: WithUidTuple>(&mut self, entity_uid: Uid) + { + self.remove_components(entity_uid, Ids::uids()); + } + /// Stops the [`World`]. The world will finish the current tick and that tick will be /// the last. pub fn stop(&mut self) |