-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Combine Query
and QueryLens
using a type parameter for state
#18162
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
Open
chescock
wants to merge
17
commits into
bevyengine:main
Choose a base branch
from
chescock:query-owned-state
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+509
−384
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e943852
Make Query generic over the State type so it can use either owned or …
chescock f7ff2b3
Make QueryLens a type alias.
chescock 0a68186
Update doc link now that `StorageId` is `pub`.
chescock 49ae0f3
Box QueryState.
chescock 2d2d78d
Rename QueryStateBorrow to QueryStateDeref.
chescock 4c367db
Make QueryStateDeref an unsafe trait.
chescock 556eced
Introduce a TrustedEntityQueryData trait so we can make a blanket `im…
chescock c81671d
Doc fixes.
chescock e94970c
Better docs for `TrustedEntityQueryData` from @Victoronz
chescock 39c8c16
Use pointer casts for `Box<QueryState>::into_readonly()` to avoid nee…
chescock 3d2bba9
Merge remote-tracking branch 'remotes/origin/main' into query-owned-s…
chescock ddd30a5
Fix other references to `TrustedEntityBorrow`.
chescock 0e61022
Rename `TrustedEntityQueryData` to `EntityEquivalentQueryData`.
chescock 3e83269
Merge remote-tracking branch 'remotes/origin/main' into query-owned-s…
chescock de74769
Add migration guide.
chescock 1751fa0
Merge branch 'main' into query-owned-state
chescock fccca4d
bevy_platform_support was renamed bevy_platform.
chescock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What do you think about leaving out the
Equivalent
from the trait name?It seems redundant, the bound on
Item
defines what this trait sees as an entity, and plainEntityQueryData
would be easier to parse/understand imo.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.
I don't have any especially strong opinions here. Most people won't need to look at this trait at all; they'll expect
QueryIter<Entity>
to be usable as anEntitySet
, and it will be, so they won't worry about how that was implemented.The trickiest part here is that
MainEntity
andRenderEntity
areEntityEquivalent + QueryData
, but can't beEntityEquivalentQueryData
because they return a different entity. So maybeEntityEquivalentQueryData
is misleading on that count? ButEntityQueryData
seems like it has the same confusion. Maybe something math-y? No,ReflexiveEntityQueryData
just sounds awkward.Since the stakes are low and none of the options seem perfect, I'm inclined to leave it alone for now, but if you argue more then I'll probably change it rather than argue back :).