Following up on #396 there are some known issues where changes to anchor-dependent types (Point, Edge, Path) can result in inconsistent state where Anchors mistakenly think it has a dependent that it actually doesn't. There could also be cases where Anchors aren't aware of a dependent that it does have, and we just haven't caught that yet.
This problem is strongly tied into the concept of relationships in bevy, but unfortunately bevy relationships currently only support one-to-many relationships, but anchors need many-to-many.
My instinct would be to use observers or component hooks, but I'm not aware of a way to trigger either for a modification (rather than an insert). Instead we might need to make systems that track Changed<Point>, Changed<Edge>, and Changed<Path>. We'll need to introduce a LastKnown<T> component to store the last known value of Point, Edge, or Path and do a comparison between the last known value and the current value every time a change is detected. Then we can subtract dependents from anchors that are no longer used and add dependents to newly used anchors.
Following up on #396 there are some known issues where changes to anchor-dependent types (Point, Edge, Path) can result in inconsistent state where Anchors mistakenly think it has a dependent that it actually doesn't. There could also be cases where Anchors aren't aware of a dependent that it does have, and we just haven't caught that yet.
This problem is strongly tied into the concept of relationships in bevy, but unfortunately bevy relationships currently only support one-to-many relationships, but anchors need many-to-many.
My instinct would be to use observers or component hooks, but I'm not aware of a way to trigger either for a modification (rather than an insert). Instead we might need to make systems that track
Changed<Point>,Changed<Edge>, andChanged<Path>. We'll need to introduce aLastKnown<T>component to store the last known value ofPoint,Edge, orPathand do a comparison between the last known value and the current value every time a change is detected. Then we can subtract dependents from anchors that are no longer used and add dependents to newly used anchors.