diff options
author | HampusM <hampus@hampusmat.com> | 2024-08-02 16:36:33 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-08-02 16:36:33 +0200 |
commit | 8bfef89e26c880b2c2f5c1c7b81ede90c40fa015 (patch) | |
tree | 3914882e55c1e9e4b623196dce6903d342a0a897 | |
parent | fd42ca5a25f8bab3ea66252f8bc0db02604f70dd (diff) |
feat(engine): make Engine::spawn return the spawned entity's UID
-rw-r--r-- | engine/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/engine/src/lib.rs b/engine/src/lib.rs index bd954be..6d7fa1e 100644 --- a/engine/src/lib.rs +++ b/engine/src/lib.rs @@ -2,6 +2,7 @@ #![allow(clippy::needless_pass_by_value)] use ecs::component::Sequence as ComponentSequence; +use ecs::entity::Uid as EntityUid; use ecs::event::Event; use ecs::extension::Extension; use ecs::sole::Sole; @@ -76,11 +77,11 @@ impl Engine Self { world } } - pub fn spawn<Comps>(&mut self, components: Comps) + pub fn spawn<Comps>(&mut self, components: Comps) -> EntityUid where Comps: ComponentSequence, { - self.world.create_entity(components); + self.world.create_entity(components) } pub fn register_system<'this, SystemImpl>( |