Add Allows filter to bypass DefaultQueryFilters#18192
Add Allows filter to bypass DefaultQueryFilters#18192alice-i-cecile merged 1 commit intobevyengine:mainfrom
Conversation
| let mut query = QueryState::<Has<C>>::new(&mut world); | ||
| assert_eq!(3, query.iter(&world).count()); | ||
|
|
||
| // Allows should bypass the filter entirely |
There was a problem hiding this comment.
Is it possible to write or update a test or example explaining why allows is different than has?
Carter0
left a comment
There was a problem hiding this comment.
Could use an example, but I think the implementation is good!
|
I don't think this use of "archetypal" access matches the original intent. (Although I don't know whether anyone is actually using it for its original purpose!) From #11700,
I'd gently vote for making this a new kind of access. If we do want to use "archetypal" for this, then we should probably update the doc comment to say something other than "whose presence in an archetype may affect query results". |
I'm sympathetic to this, but I'm reluctant to block this particular PR over it, or to add more complexity for a very niche feature currently. |
# Objective Fixes bevyengine#17803 ## Solution - Add an `Allows<T>` `QueryFilter` that adds archetypal access for `T` - Fix access merging to include archetypal from both sides ## Testing - Added a case to the unit test for the application of `DefaultQueryFilters`
Objective
Fixes #17803
Solution
Allows<T>QueryFilterthat adds archetypal access forTTesting
DefaultQueryFilters