thesadrogue / TheSadRogue.Primitives

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

Modify Area to present operations equivalent to the ones for hash set #86

Open Chris3606 opened 2 years ago

Chris3606 commented 2 years ago

Currently, Area offers GetIntersection, GetDifference, and GetUnion functions. C#'s HashSet<T> offers similar operations, but they're called IntersectWith, ExceptWIth, and UnionWith, respectively. C#'s operations generally take IEnumerable<T> as well.

It should be possible to implement area's interface similarly; or, at least, to provide functions that mimic this API. This can also avoid the need to re-allocate an area, if a user desires.