I need to store a collection of Point pairs, but don't want to use plain C# arrays to be bound to use of iterators. Which is the easiest way (except using KeyValuePair<Point,Point>) to have such an two dimensional collection at hand with being able to .Add(Point, Point) to it?
Point,Point is not a key-value pair, it's a Tuple<Point,Point>. You can create a List<Tuple<Point,Point>> or whatever fits your needs.
However, you should keep something in mind - a Tuple is an immutable structure - you can't change it's elements to point to other Point objects (however, if the Point object itself is mutable, you could mutate the Point). If you need to be able to change elements from this list to point to other points, create your own class to hold these.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With