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

Writable Pointers for Added, Mutated, Changed queries #217

Closed
insrcd opened this issue Aug 17, 2020 · 1 comment
Closed

Writable Pointers for Added, Mutated, Changed queries #217

insrcd opened this issue Aug 17, 2020 · 1 comment
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible

Comments

@insrcd
Copy link

insrcd commented Aug 17, 2020

Currently there is not a way to mutate a component that has been provided to a QueryBorrow with the Added/Mutated/Changed series of structs that impl Query. These structs do not implement DerefMut, so there isn't a safe way to get a mutable reference to the component.
It was suggested in Discord that new writable change detection pointers could be the path forward on this, e.g.MutatedMut, ChangedMut, AddedMut` that would allow inner mutability of the value and track the changes made.

The work around I am using for this is are multiple component queries with mut versions of the components and entity comparisons, but it is a bit clunky - if there is a better work around that I'm missing, it would also be appreciated.

@karroffel karroffel added A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible labels Aug 17, 2020
@Moxinilian
Copy link
Member

Fixed in #834

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

No branches or pull requests

3 participants