From c9a07ff61b607478e264fc0581076643c750fe98 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 16 Nov 2024 17:14:20 +0100 Subject: refactor(ecs): remove system param compatability checking --- ecs/src/query.rs | 49 +------------------------------------------------ 1 file changed, 1 insertion(+), 48 deletions(-) (limited to 'ecs/src/query.rs') diff --git a/ecs/src/query.rs b/ecs/src/query.rs index 69bb35d..253398d 100644 --- a/ecs/src/query.rs +++ b/ecs/src/query.rs @@ -1,5 +1,3 @@ -use std::any::Any; -use std::collections::HashSet; use std::iter::{Filter, Flatten, Map}; use std::marker::PhantomData; @@ -10,11 +8,7 @@ use crate::component::storage::{ EntityIter, Storage as ComponentStorage, }; -use crate::component::{ - Component, - Metadata as ComponentMetadata, - Sequence as ComponentSequence, -}; +use crate::component::{Component, Sequence as ComponentSequence}; use crate::lock::{ReadGuard, WriteGuard}; use crate::query::options::Options; use crate::system::{ @@ -149,24 +143,6 @@ where { Self::new(world) } - - fn is_compatible>() -> bool - { - let other_comparable = Other::get_comparable(); - - let Some(other_query_component_ids) = - other_comparable.downcast_ref::() - else { - return true; - }; - - !other_query_component_ids.contains_component_in::() - } - - fn get_comparable() -> Box - { - Box::new(QueryComponentIds { component_ids: Comps::metadata() }) - } } type ComponentIterMapFn = for<'a> fn(&'a Archetype) -> EntityIter<'a>; @@ -259,26 +235,3 @@ fn lock_component_ro( ); }) } - -#[derive(Debug)] -struct QueryComponentIds -{ - component_ids: Vec, -} - -impl QueryComponentIds -{ - fn contains_component_in(&self) -> bool - where - OtherComps: ComponentSequence, - { - let other_ids = OtherComps::metadata() - .into_iter() - .map(|component_metadata| component_metadata.id) - .collect::>(); - - self.component_ids - .iter() - .all(|component_metadata| other_ids.contains(&component_metadata.id)) - } -} -- cgit v1.2.3-18-g5258