From a1816f82c2d5c18cfd3282047632959028685a45 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 13 Oct 2025 22:03:22 +0200 Subject: feat(ecs): add get_wildcard_pair_matches fn to entity::Handle --- ecs/src/entity.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'ecs/src/entity.rs') diff --git a/ecs/src/entity.rs b/ecs/src/entity.rs index 8c07ea8..ad9f179 100644 --- a/ecs/src/entity.rs +++ b/ecs/src/entity.rs @@ -12,7 +12,12 @@ use crate::component::{ Handle as ComponentHandle, HandleMut as ComponentHandleMut, }; -use crate::pair::{ComponentOrWildcard, Pair, WithWildcard as PairWithWildcard}; +use crate::pair::{ + ComponentOrWildcard, + MultipleWithWildcard as PairMultipleWithWildcard, + Pair, + WithWildcard as PairWithWildcard, +}; use crate::uid::{Kind as UidKind, Uid}; use crate::{EntityComponentRef, World}; @@ -174,6 +179,17 @@ impl<'a> Handle<'a> Some(PairWithWildcard::new(self.world, matching_comps.next()?)) } + #[must_use] + pub fn get_wildcard_pair_matches( + &self, + ) -> PairMultipleWithWildcard<'a, Relation, Target> + where + Relation: ComponentOrWildcard, + Target: ComponentOrWildcard, + { + PairMultipleWithWildcard::new(self.world, self.clone()) + } + #[inline] #[must_use] pub fn get_matching_components(&self, component_uid: Uid) -- cgit v1.2.3-18-g5258