summaryrefslogtreecommitdiff
path: root/engine-ecs/src/extension.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine-ecs/src/extension.rs')
-rw-r--r--engine-ecs/src/extension.rs13
1 files changed, 13 insertions, 0 deletions
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<Comps>(
+ &mut self,
+ name: impl Into<Cow<'static, str>>,
+ 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)
{