summaryrefslogtreecommitdiff
path: root/ecs/src/lib.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2025-09-28 13:53:28 +0200
committerHampusM <hampus@hampusmat.com>2025-09-28 13:53:28 +0200
commit0008b374c7f3a9ef6b30ea31a4a8c98bce64649f (patch)
tree9d9fffc6cae105e32d57f2aa4936881bea7e3cc2 /ecs/src/lib.rs
parent43430f8ce957290caf70b6ca0da0b8fd326f32c0 (diff)
feat(ecs): add POST_UPDATE phaseHEADmaster
Diffstat (limited to 'ecs/src/lib.rs')
-rw-r--r--ecs/src/lib.rs30
1 files changed, 17 insertions, 13 deletions
diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs
index fa5a352..fce780c 100644
--- a/ecs/src/lib.rs
+++ b/ecs/src/lib.rs
@@ -23,10 +23,15 @@ use crate::event::component::{Added, Removed};
use crate::event::{Emitted as EmittedEvent, NewEvents, Submitter as EventSubmitter};
use crate::extension::{Collector as ExtensionCollector, Extension};
use crate::lock::Lock;
-use crate::pair::{ChildOf, DependsOn, Pair, Wildcard};
-use crate::phase::{Phase, START as START_PHASE};
+use crate::pair::{ChildOf, DependsOn, Pair};
+use crate::phase::{
+ Phase,
+ POST_UPDATE as POST_UPDATE_PHASE,
+ PRE_UPDATE as PRE_UPDATE_PHASE,
+ START as START_PHASE,
+ UPDATE as UPDATE_PHASE,
+};
use crate::query::flexible::Query as FlexibleQuery;
-use crate::query::term::Without;
use crate::query::{
TermWithFieldTuple as QueryTermWithFieldTuple,
TermWithoutFieldTuple as QueryTermWithoutFieldTuple,
@@ -388,18 +393,17 @@ impl World
}
}
- fn perform_phases(&self)
+ fn perform_single_phase(&self, phase_entity_id: Uid)
{
- let phase_query = self.query::<(&Phase,), (Without<Pair<ChildOf, Wildcard>>,)>();
-
- for (phase_entity_id, _) in phase_query.iter_with_euids() {
- if phase_entity_id == *START_PHASE {
- continue;
- }
+ self.query_and_run_systems(phase_entity_id);
+ self.perform_child_phases(phase_entity_id);
+ }
- self.query_and_run_systems(phase_entity_id);
- self.perform_child_phases(phase_entity_id);
- }
+ fn perform_phases(&self)
+ {
+ self.perform_single_phase(*PRE_UPDATE_PHASE);
+ self.perform_single_phase(*UPDATE_PHASE);
+ self.perform_single_phase(*POST_UPDATE_PHASE);
}
fn emit_new_events(&self)