I have a method like:
AverageAndDoSomeMath (Point2)
and I wonder how to handle:
AverageAndDoSomeMath (Point2) // single
AverageAndDoSomeMath (Point2 collection) // multiple
using a single implementation preferably.
For collection, I plan to use the IEnumerable type so I can pass any kind of collection, but for a single value, I don't want to wrap and pass it as a collection, because the collection itself serves no purpose, other than to satisfy the type.
How to best handle it in the clearest, fastest, most efficient way?
EDIT: Maybe I should have chosen a better method name, but the method calculates the average of all the points, for 1 value it doesn't make sense, but think of it as that the value will be used to say calculate another value, but what's important is finding the average, so I can't call the 1st method.