Skip to content

Commit

Permalink
document new access methods
Browse files Browse the repository at this point in the history
  • Loading branch information
hymm committed Oct 10, 2023
1 parent 6f2e9c0 commit 227dc00
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_ecs/src/query/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ impl<T: SparseSetIndex> Access<T> {
self.writes.ones().map(T::get_sparse_set_index)
}

/// checks if the difference of `self` with `other` is empty
pub fn read_and_writes_difference_is_empty(&self, other: &Access<T>) -> bool {
if self.reads_all || self.writes_all {
return other.reads_all || other.writes_all;
Expand All @@ -280,6 +281,7 @@ impl<T: SparseSetIndex> Access<T> {
== 0
}

/// checks if there is any access set
pub fn has_access(&self) -> bool {
self.writes_all || self.reads_all || !self.reads_and_writes.is_clear()
}
Expand Down

0 comments on commit 227dc00

Please sign in to comment.