File tree Expand file tree Collapse file tree
crates/bevy_ecs/src/query Expand file tree Collapse file tree Original file line number Diff line number Diff 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`,
You can’t perform that action at this time.
0 commit comments