diff options
author | HampusM <hampus@hampusmat.com> | 2024-08-14 20:08:13 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-08-14 20:08:13 +0200 |
commit | 48a415c63b7b98c5947e1517370eb8323b7b2a33 (patch) | |
tree | 936a5fb6eaf9ec8e8d3f4b1c01ed9f3a48ff9743 /engine/src | |
parent | 07aa59a122cc5e14d2fb2e2c6e3d8f82e4397bde (diff) |
fix(engine): make Engine::spawn have bound TupleReduce on Comps
Diffstat (limited to 'engine/src')
-rw-r--r-- | engine/src/lib.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/engine/src/lib.rs b/engine/src/lib.rs index 9400e56..6d7c213 100644 --- a/engine/src/lib.rs +++ b/engine/src/lib.rs @@ -3,10 +3,12 @@ use ecs::component::Sequence as ComponentSequence; use ecs::entity::Uid as EntityUid; -use ecs::event::Event; +use ecs::event::component::ComponentToAddedEvent; +use ecs::event::{Event, Sequence as EventSequence}; use ecs::extension::Extension; use ecs::sole::Sole; use ecs::system::{Into, System}; +use ecs::tuple::Reduce as TupleReduce; use ecs::{SoleAlreadyExistsError, World}; use crate::delta_time::{update as update_delta_time, DeltaTime, LastUpdate}; @@ -75,7 +77,8 @@ impl Engine pub fn spawn<Comps>(&mut self, components: Comps) -> EntityUid where - Comps: ComponentSequence, + Comps: ComponentSequence + TupleReduce<ComponentToAddedEvent>, + Comps::Out: EventSequence, { self.world.create_entity(components) } |