-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve docs for WorldQuery
#17654
Improve docs for WorldQuery
#17654
Conversation
/// For `QueryFilter` this will be either `()`, or a `bool` indicating whether the entity should be included | ||
/// or a tuple of such things. | ||
/// Archetypal query filters (like `With`) set this to `()`, as the filtering is done by selecting the archetypes to iterate over, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's kind of weird that QueryFilter
s even have an Item
. I think it's mostly because they used to be a single trait, and the change to separate them tried to minimize changes.
Would be more clear if we moved Item
and fetch
from WorldQuery
to QueryData
, and then did all the filtering in filter_fetch
? (Not in this PR, of course.) It doesn't look like fetch
is ever called on a QueryFilter
outside its own implementation, so that might work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spun out into #17662. Fully agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good stuff!
Co-authored-by: James O'Brien <[email protected]>
Really excellent suggestions; thank you all. Waiting on one re-review before merging. |
# Objective While working on bevyengine#17649, I found the docs for `WorldQuery` and the related traits frustratingly vague. ## Solution Clarify them and add some more tangible advice. Also fix a copy-pasted typo in related comments. --------- Co-authored-by: James O'Brien <[email protected]>
# Objective While working on bevyengine#17649, I found the docs for `WorldQuery` and the related traits frustratingly vague. ## Solution Clarify them and add some more tangible advice. Also fix a copy-pasted typo in related comments. --------- Co-authored-by: James O'Brien <[email protected]>
Objective
While working on #17649, I found the docs for
WorldQuery
and the related traits frustratingly vague.Solution
Clarify them and add some more tangible advice.
Also fix a copy-pasted typo in related comments.