From 0b78c7da4980c90c2feca1ef7e0ee898db084486 Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 8 Jul 2026 23:30:50 +0200 Subject: feat(engine-ecs): add fns for spawning named entities --- engine-ecs/src/extension.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'engine-ecs/src/extension.rs') diff --git a/engine-ecs/src/extension.rs b/engine-ecs/src/extension.rs index 1975933..ac989c9 100644 --- a/engine-ecs/src/extension.rs +++ b/engine-ecs/src/extension.rs @@ -1,3 +1,5 @@ +use std::borrow::Cow; + use crate::component::Sequence as ComponentSequence; use crate::entity::Declaration as EntityDeclaration; use crate::sole::Sole; @@ -53,6 +55,17 @@ impl<'world> Collector<'world> self.world.spawn(components); } + /// Adds a entity to the [`World`]. + pub fn spawn_named( + &mut self, + name: impl Into>, + components: Comps, + ) where + Comps: ComponentSequence, + { + self.world.spawn_named(name, components); + } + /// Adds a declared entity to the [`World`]. pub fn spawn_declared_entity(&mut self, entity_decl: &EntityDeclaration) { -- cgit v1.2.3-18-g5258