Skip to content

Commit 2c062a8

Browse files
committed
More impl
1 parent ee0458c commit 2c062a8

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

crates/bevy_ecs/src/query/access.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,23 @@ pub enum InvertibleComponentIdSet<'a> {
505505
Excluded(&'a ComponentIdSet),
506506
}
507507

508+
impl InvertibleComponentIdSet<'_> {
509+
/// Returns true if this is Excluded, otherwise false
510+
pub fn inverted(&self) -> bool {
511+
match self {
512+
InvertibleComponentIdSet::Included(_) => false,
513+
InvertibleComponentIdSet::Excluded(_) => true,
514+
}
515+
}
516+
517+
/// Iterate the underlying component ids
518+
pub fn iter(&self) -> ComponentIdIter<Ones<'_>> {
519+
match self {
520+
InvertibleComponentIdSet::Included(b) | InvertibleComponentIdSet::Excluded(b) => b.iter(),
521+
}
522+
}
523+
}
524+
508525
/// Performs an in-place union of `other` into `self`, where either set may be inverted.
509526
///
510527
/// Each set corresponds to a `FixedBitSet` if `inverted` is `false`,

0 commit comments

Comments
 (0)