Closed TrevorCow closed 1 year ago
Bundles own components, whereas queries borrow them, so they must be different types. Further, a query has to decide whether it should take a shared or unique borrow of a component, whereas no such distinction exists for bundles, so even generating a query type from a bundle wouldn't make sense; we'd need 2^n variants to cover every use case.
Oh I see you could have (&String, &MovableComp)
, (&mut String, &MovableComp)
, (&String, &mut MovableComp)
, or (&mut String, &mut MovableComp)
. Interesting and very cool! Thanks for the explanation.
If I have:
I can spawn it in a world with something like this:
However, I can not get all the
EntityPlayer
s withIs this correct behavior? It can easily be fixed with a Query struct like
but I'd rather not have to make a bunch of queries for my Bundles. Is there another way I should be doing this?