diff options
Diffstat (limited to 'ecs/src/lib.rs')
-rw-r--r-- | ecs/src/lib.rs | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs index 0da8b71..34d6b7b 100644 --- a/ecs/src/lib.rs +++ b/ecs/src/lib.rs @@ -94,8 +94,6 @@ impl World ) where EventT: Event, { - system.prepare(&self.data); - self.systems.push(system.into_type_erased()); self.data @@ -155,27 +153,12 @@ impl World { match action { Action::Spawn(components) => { - { - let mut component_storage_lock = - self.data.component_storage.write_nonblock().expect( - "Failed to acquire read-write component storage lock", - ); - - component_storage_lock.push_entity(components); - } - - for system in &self.systems { - unsafe { - system.prepare(&self.data); - } - } - let mut component_storage_lock = self.data.component_storage.write_nonblock().expect( "Failed to acquire read-write component storage lock", ); - component_storage_lock.make_archetype_lookup_entries(); + component_storage_lock.push_entity(components); } Action::Stop => { self.stop.store(true, Ordering::Relaxed); @@ -184,18 +167,6 @@ impl World } } - /// Prepares the world. Should be called before manually emitting events and after - /// creating entities, registering systems & adding extensions. You do not need to - /// call this function if you use [`event_loop`]. - pub fn prepare(&self) - { - self.data - .component_storage - .write_nonblock() - .expect("Failed to acquire read-write component storage lock") - .make_archetype_lookup_entries(); - } - /// A event loop which runs until a stop is issued with [`Flags::stop`]. Before the /// loop begins, [`StartEvent`] is emitted. /// @@ -203,8 +174,6 @@ impl World /// Will panic if a internal lock cannot be acquired. pub fn event_loop<EventSeq: EventSequence>(&self) { - self.prepare(); - self.emit(StartEvent); let event_seq = EventSeq::ids(); |