thesadrogue / TheSadRogue.Primitives

A collection of primitive data structures for working with a 2-dimensional grid.
MIT License
21 stars 6 forks source link

Add Built-In Syncing of Spatial Maps to Items which Have a Position Field #116

Closed Chris3606 closed 1 year ago

Chris3606 commented 1 year ago

Currently, spatial maps require you to manually keep items at the correct position in the spatial map by calling Move. In the case of objects that have a Position field and a Moved event, that wouldn't be strictly necessary; if the spatial map can detect this, it could keep things synced automatically.

This issue (now closed) in GoRogue points to a proposal to solve this.

The main issue would be doing it in an intuitive way which does not cost performance. Further testing and development is needed; but it should be possible one way or another.

Thraka commented 1 year ago

I read through the previous issue and I agree, we should move (pun!!) on this. Position property with a Moved event. Sounds good to me.