From 3ea0d8cc96a54349aa064bb2fbf349b129e51c94 Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 7 Aug 2024 20:03:49 +0200 Subject: feat(ecs): add start event --- ecs/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ecs/src/lib.rs') diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs index cf2f198..0da8b71 100644 --- a/ecs/src/lib.rs +++ b/ecs/src/lib.rs @@ -13,6 +13,7 @@ use crate::actions::Action; use crate::component::storage::Storage as ComponentStorage; use crate::component::{Component, Id as ComponentId, Sequence as ComponentSequence}; use crate::entity::Uid as EntityUid; +use crate::event::start::Start as StartEvent; use crate::event::{Event, Id as EventId, Ids, Sequence as EventSequence}; use crate::extension::{Collector as ExtensionCollector, Extension}; use crate::lock::Lock; @@ -195,7 +196,8 @@ impl World .make_archetype_lookup_entries(); } - /// A event loop which runs until a stop is issued with [`Flags::stop`]. + /// A event loop which runs until a stop is issued with [`Flags::stop`]. Before the + /// loop begins, [`StartEvent`] is emitted. /// /// # Panics /// Will panic if a internal lock cannot be acquired. @@ -203,6 +205,8 @@ impl World { self.prepare(); + self.emit(StartEvent); + let event_seq = EventSeq::ids(); loop { -- cgit v1.2.3-18-g5258