summaryrefslogtreecommitdiff
path: root/engine-ecs/src/extension.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-07-08 23:19:06 +0200
committerHampusM <hampus@hampusmat.com>2026-07-08 23:19:06 +0200
commit213e4cfc698f0e0f9fcfbe43cf8c49f8f331e699 (patch)
tree666b38f087985fa0ed6d85f3d046760b16666365 /engine-ecs/src/extension.rs
parent05063e79465a33eb156c25edf8193fd77ba24314 (diff)
refactor(engine-ecs): rename entity creation fns to use 'spawn' terminology
Diffstat (limited to 'engine-ecs/src/extension.rs')
-rw-r--r--engine-ecs/src/extension.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/engine-ecs/src/extension.rs b/engine-ecs/src/extension.rs
index 9c6614b..1975933 100644
--- a/engine-ecs/src/extension.rs
+++ b/engine-ecs/src/extension.rs
@@ -46,23 +46,23 @@ impl<'world> Collector<'world>
}
/// Adds a entity to the [`World`].
- pub fn add_entity<Comps>(&mut self, components: Comps)
+ pub fn spawn<Comps>(&mut self, components: Comps)
where
Comps: ComponentSequence,
{
- self.world.create_entity(components);
+ self.world.spawn(components);
}
/// Adds a declared entity to the [`World`].
- pub fn add_declared_entity(&mut self, entity_decl: &EntityDeclaration)
+ pub fn spawn_declared_entity(&mut self, entity_decl: &EntityDeclaration)
{
- self.world.create_declared_entity(entity_decl);
+ self.world.spawn_declared_entity(entity_decl);
}
- /// Adds a globally shared singleton value to the [`World`].
+ /// Adds a singleton component to the [`World`].
///
/// # Errors
- /// Returns `Err` if this [`Sole`] has already been added.
+ /// Returns `Err` if the [`Sole`] already exists.
pub fn add_sole<SoleT>(&mut self, sole: SoleT) -> Result<(), SoleAlreadyExistsError>
where
SoleT: Sole,