-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Getting QueryState
from immutable World
reference
#16434
base: main
Are you sure you want to change the base?
Conversation
This partially resolves #3774 :) |
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'd prefer to return results everywhere in this chain to improve debugging, but this is a very useful workaround currently.
That should be done in follow-up, but for now, can you add World::try_query
+ try_query_filtered
methods to make this easier to use?
Objective
There is currently no way of getting
QueryState
from&World
, so it is hard to, for example, iterate over all entities with a component, only having&World
.Solution
Add
try_new
function toQueryState
that internally usesWorldQuery
'sget_state
.Testing
No testing