Sugar for filtering queries by entity #2010
Labels
A-ECS
Entities, components, systems, and events
C-Feature
A new feature, making something new possible
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
What problem does this solve or what need does it fill?
When working with queries, a reasonably common pattern is to dynamically determine some list of entities on which work should be done, then check if the entities in the query match.
This is boilerplate heavy, and forces you to fetch Entity in your query.
What solution would you like?
Write convenience wrappers for query that filter by Vec in both an allow-list and block-list fashion.
What alternative(s) have you considered?
Accept an iterator of Entities instead.
Frame this functionality as
get_multiple
.Only include this as a special set of methods on relation filters alone.
Write out the logic manually each time.
Create examples showing how to use existing method chaining to do this very nicely in vanilla Rust.
Additional context
Similar in character to #1658. This idea was inspired by the notion of "source filtering" of relations in bevyengine/rfcs#18.
Assuming relations are accepted, we should consider a relation filter API similar to that originally proposed in the RFC.
The text was updated successfully, but these errors were encountered: