Skip to content

Writable Pointers for Added, Mutated, Changed queries #217

@insrcd

Description

@insrcd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions