Skip to content
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

Implement QueryData for EntityLocation #12392

Closed
urben1680 opened this issue Mar 9, 2024 · 0 comments · Fixed by #12398
Closed

Implement QueryData for EntityLocation #12392

urben1680 opened this issue Mar 9, 2024 · 0 comments · Fixed by #12398
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible

Comments

@urben1680
Copy link
Contributor

urben1680 commented Mar 9, 2024

Description of the feature request

EntityLocation is a struct that can be accessed with EntityRef and EntityMut in a query. These latter two however hurt parallization when queried. If one does that only to get EntityLocation, that restriction is needless as the location alone does not require further access to the component data.
It would make sense to offer this type as a QueryData that can also be freely added to a query with Query::transmute_lense.

What problem does this solve or what need does it fill?

I have no personal use case, I just noticed that when looking through the docs to answer someone's question, what else than components can be queried. If someone can come up with an actual use case, please share it in this issue.

@urben1680 urben1680 added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Mar 9, 2024
@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events and removed S-Needs-Triage This issue needs to be labelled labels Mar 9, 2024
github-merge-queue bot pushed a commit that referenced this issue Mar 29, 2024
# Objective
Fixes #12392, fixes #12393, and fixes #11387. Implement QueryData for
Archetype and EntityLocation.

## Solution
Add impls for both of the types.

---

## Changelog
Added: `&Archetype` now implements `QueryData`
Added: `EntityLocation` now implements `QueryData`

---------

Co-authored-by: Alice Cecile <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants