From 89724815230c4fcab81111f626bd4bb8b12db7bd Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 31 Oct 2026 14:46:39 +0100 Subject: feat(engine-ecs): add Actions fn to create sole --- engine-ecs/src/actions.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engine-ecs/src/actions.rs') diff --git a/engine-ecs/src/actions.rs b/engine-ecs/src/actions.rs index cef51cc..f1a1541 100644 --- a/engine-ecs/src/actions.rs +++ b/engine-ecs/src/actions.rs @@ -10,6 +10,7 @@ use crate::component::{ use crate::entity::Name as EntityName; use crate::event::component::Removed; use crate::pair::Pair; +use crate::sole::Sole; use crate::system::{Metadata as SystemMetadata, Param as SystemParam}; use crate::uid::Uid; use crate::{ActionQueue, World}; @@ -304,6 +305,16 @@ impl Actions<'_> }); } + /// Queues up a entity to spawn at the end of the current tick, returning the [`Uid`] + /// that the entity will have. + pub fn create_sole(&mut self, sole: SoleT) -> Uid + { + self.action_queue + .push(Action::CreateSole(sole.into_parts())); + + SoleT::id() + } + /// Stops the [`World`]. The world will finish the current tick and that tick will be /// the last. pub fn stop(&mut self) @@ -339,5 +350,6 @@ pub(crate) enum Action pair_id: Uid, new_pair: ComponentParts, }, + CreateSole(ComponentParts), Stop, } -- cgit v1.2.3-18-g5258