From 07aa59a122cc5e14d2fb2e2c6e3d8f82e4397bde Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 14 Aug 2024 20:05:30 +0200 Subject: feat(ecs): add component added event --- ecs/src/extension.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ecs/src/extension.rs') diff --git a/ecs/src/extension.rs b/ecs/src/extension.rs index fc5a345..99320cb 100644 --- a/ecs/src/extension.rs +++ b/ecs/src/extension.rs @@ -1,7 +1,9 @@ use crate::component::Sequence as ComponentSequence; -use crate::event::Event; +use crate::event::component::ComponentToAddedEvent; +use crate::event::{Event, Sequence as EventSequence}; use crate::sole::Sole; use crate::system::System; +use crate::tuple::Reduce as TupleReduce; use crate::{SoleAlreadyExistsError, World}; /// A collection of systems, entities & soles that can be added to a [`World`]. @@ -38,7 +40,8 @@ impl<'world> Collector<'world> /// Adds a entity to the [`World`]. pub fn add_entity(&mut self, components: Comps) where - Comps: ComponentSequence, + Comps: ComponentSequence + TupleReduce, + Comps::Out: EventSequence, { self.world.create_entity(components); } -- cgit v1.2.3-18-g5258