From fe62665b1d62d36ee0839e6bf24e3841ea667da9 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 21 Mar 2025 20:05:53 +0100 Subject: refactor(ecs): replace query options with fieldless terms --- ecs/src/lib.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'ecs/src/lib.rs') diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs index cb2059b..9b787a2 100644 --- a/ecs/src/lib.rs +++ b/ecs/src/lib.rs @@ -18,11 +18,13 @@ use crate::extension::{Collector as ExtensionCollector, Extension}; use crate::lock::{Lock, WriteGuard}; use crate::phase::{Phase, START as START_PHASE}; use crate::query::flexible::Query as FlexibleQuery; -use crate::query::options::{Not, Options as QueryOptions, With}; +use crate::query::term::Without; use crate::query::{ ComponentIter, - TermSequence as QueryTermSequence, + TermWithFieldTuple as QueryTermWithFieldTuple, + TermWithoutFieldTuple as QueryTermWithoutFieldTuple, Terms as QueryTerms, + TermsBuilderInterface, }; use crate::relationship::{ChildOf, DependsOn, Relationship}; use crate::sole::Sole; @@ -173,10 +175,10 @@ impl World extension.collect(extension_collector); } - pub fn query(&self) -> Query + pub fn query(&self) -> Query where - Terms: QueryTermSequence, - OptionsT: QueryOptions, + FieldTerms: QueryTermWithFieldTuple, + FieldlessTerms: QueryTermWithoutFieldTuple, { Query::new(self) } @@ -283,7 +285,7 @@ impl World fn perform_phases(&self) { let phase_query = - self.query::<(&Phase,), Not>>>(); + self.query::<(&Phase,), (Without>,)>(); for (phase_euid, (_,)) in phase_query.iter_with_euids() { if phase_euid == *START_PHASE { @@ -492,8 +494,7 @@ impl World .build(), ); - for (system,) in - ComponentIter::<(&SystemComponent,), _>::new(self, query.iter::<()>()) + for (system,) in ComponentIter::<(&SystemComponent,), _>::new(self, query.iter()) { unsafe { system.system.run(self); -- cgit v1.2.3-18-g5258