diff options
author | HampusM <hampus@hampusmat.com> | 2024-12-09 14:05:33 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2024-12-09 14:05:33 +0100 |
commit | dcc40c9205e5f4cf484523f97eb12a561d7b2b22 (patch) | |
tree | 2908b6ca3b2fa390a45b383b91edf7a72c42ef4b /ecs/src/extension.rs | |
parent | 158e36bf6bfcbc2ed0ffc670788ed8c0abd3f282 (diff) |
refactor(ecs): use phases for system ordering
Diffstat (limited to 'ecs/src/extension.rs')
-rw-r--r-- | ecs/src/extension.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/ecs/src/extension.rs b/ecs/src/extension.rs index a945d89..42ebef9 100644 --- a/ecs/src/extension.rs +++ b/ecs/src/extension.rs @@ -1,9 +1,7 @@ use crate::component::Sequence as ComponentSequence; -use crate::event::component::TypeTransformComponentsToAddedEvents; -use crate::event::{Event, Sequence as EventSequence}; use crate::sole::Sole; use crate::system::System; -use crate::tuple::Reduce as TupleReduce; +use crate::uid::Uid; use crate::{SoleAlreadyExistsError, World}; /// A collection of systems, entities & soles that can be added to a [`World`]. @@ -27,21 +25,19 @@ impl<'world> Collector<'world> } /// Adds a system to the [`World`]. - pub fn add_system<'this, EventT, SystemImpl>( + pub fn add_system<'this, SystemImpl>( &'this mut self, - event: EventT, + phase_euid: Uid, system: impl System<'this, SystemImpl>, - ) where - EventT: Event, + ) { - self.world.register_system(event, system); + self.world.register_system(phase_euid, system); } /// Adds a entity to the [`World`]. pub fn add_entity<Comps>(&mut self, components: Comps) where - Comps: ComponentSequence + TupleReduce<TypeTransformComponentsToAddedEvents>, - Comps::Out: EventSequence, + Comps: ComponentSequence, { self.world.create_entity(components); } |