-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Support With<Bundle> rather than just With<Component> #9215
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
Comments
This is definitely feasible, and should be easy to implement. However, whether it's a good idea is hotly contested. Querying for "all entities with this bundle" is a common pattern in beginners coming from more OOP backgrounds, but tends to push towards less idiomatic, less behavior-first system design. |
I just started contribution to bevy, so my question might be a fool. :) How to bundle in the following case. or should we skip this case? pub fn my_system(Query<&Name, (With<Foo>, Without<Bar>)>) {} |
That wouldn't be able to be expressed using bundles :) |
What if instead of
So Footnotes
|
Agree with |
While this is true, it would still be nice as an option for rapid prototyping or very simple games, where modularity isn't as important. It also might help beginners transition by letting them use a more OOP style approach, and then they can refactor later once they realize they want to share behavior across all entities with specific components. It should be fairly easy to refactor game code that is written with Bundle Queries, and split it into smaller systems for each component. |
I am having trouble thinking of a case where However, if bundle Queries were re-evaluated, then we would also want |
Closing out in favor of #15327 as it better centralizes information, arguments, and the context of today. |
What problem does this solve or what need does it fill?
Now that all
Component
s areBundle
s, it seems like this could be done, in theory.It would potentially reduce Query type complexity:
What solution would you like?
Implement
With<T: Bundle>
andWithout<T: Bundle>
, rather thanWith<T: Component>
.What alternative(s) have you considered?
Continue to work under status quo.
The text was updated successfully, but these errors were encountered: