Skip to content

Commit

Permalink
Impl QueryItem for UntypedComponentStore
Browse files Browse the repository at this point in the history
  • Loading branch information
TekhnaeRaav committed May 17, 2024
1 parent aecd998 commit 99d8812
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions framework_crates/bones_ecs/src/entities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ where
OptionalQueryItemMut(component_ref, PhantomData)
}

impl<'a> QueryItem for &'a Ref<'a, UntypedComponentStore> {
type Iter = UntypedComponentBitsetIterator<'a>;
fn apply_bitset(&self, bitset: &mut BitSetVec) {
bitset.bit_and(self.bitset());
}

fn iter_with_bitset(self, bitset: Rc<BitSetVec>) -> Self::Iter {
UntypedComponentStore::iter_with_bitset(self, bitset)
}
}

impl<'a, 'q, T: HasSchema> QueryItem for &'a Comp<'q, T> {
type Iter = ComponentBitsetIterator<'a, T>;
fn apply_bitset(&self, bitset: &mut BitSetVec) {
Expand Down

0 comments on commit 99d8812

Please sign in to comment.