diff options
author | HampusM <hampus@hampusmat.com> | 2024-08-07 20:03:49 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-08-07 20:03:49 +0200 |
commit | 3ea0d8cc96a54349aa064bb2fbf349b129e51c94 (patch) | |
tree | 15803d1a0cb964f1e81830be0266b65b98c8f05d /ecs/src/lib.rs | |
parent | c2787b021d93c243978250d705a9052392f1e9a0 (diff) |
feat(ecs): add start event
Diffstat (limited to 'ecs/src/lib.rs')
-rw-r--r-- | ecs/src/lib.rs | 6 |
1 files changed, 5 insertions, 1 deletions
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 { |