diff options
Diffstat (limited to 'engine-ecs/src/actions.rs')
| -rw-r--r-- | engine-ecs/src/actions.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/engine-ecs/src/actions.rs b/engine-ecs/src/actions.rs index cef51cc..bbc19c6 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 creation of a sole at the end of the current tick, returning the [`Uid`] + /// of the sole. + pub fn create_sole<SoleT: 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, } |
