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
Refactored Query mechanisn - Nesting mechanics. #111
Merged
AndreaCatania
merged 13 commits into
GodotECS:main
from
AndreaCatania:pro_query_filters
Mar 15, 2021
Merged
Refactored Query mechanisn - Nesting mechanics. #111
AndreaCatania
merged 13 commits into
GodotECS:main
from
AndreaCatania:pro_query_filters
Mar 15, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The new type `QueryResultTuple_impl` is the new `Query` return type. It allow to have total control over the `Query` return type, so it's now possible to nest multiple filters, for fine grained fetching, while keeping the tuple unwrapping flat and easy to handle.
Can be used to extract the type of a specific query element, by Index.
The query supports all the filters now.
Implemented: - No filter - Maybe - Without - Changed - Batch Need to finish: - Join - Any
The new fetching mechanism allow to nest the filters, for a more fine-grained result. The new fetching uses the new `QueryResultTuple` instead of `std::tuple`.
The new Any filter, returns all its sub components if at least one filter is satisfied. As before, the Any filter allow to nest some filters like `Maybe`, `Without`, `Changed`, `Batch`.
Returns the first component that satisfy the sub filters.
The `Not` filter is a negation filter (similar to `!`). It can be nested, and returns the component if satisfied.
AndreaCatania
force-pushed
the
pro_query_filters
branch
from
March 15, 2021 06:24
2dafc23
to
75d5904
Compare
Wiki updated: https://github.com/GodotECS/godex/wiki/Query |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Query
mechanics, so it's now possible to combine the filters for fine-grained result!Without
filter in favor ofNot
.Query
return aQueryResultTuple
(before it was returningstd::tuple
).QueryResultTuple
for a great control over the query unpacking mechanism.Any
filter: Now it returns all theComponents
if one filter is satisfied.Join
filter: Collapse many components to one.