GetPointCount() is now a property #41

wants to merge 1 commit into

3 participants

Simple and Fast Multimedia Library member

It was impossible to change the SetPointCount on the circle and rectangle shapes because it is impossible to change the get/set definition of a property when overriding. So this is the best I can do for this. See the following link for more information.

Simple and Fast Multimedia Library member

Reminds me of something... I got stuck with the same problem, and ended up choosing consistency over making it a property at all costs.

I think this should be discussed further.


tldr: I'd keep it both as functions because it looks weird.

The problem, as I see it, is that all classes derived from Shape are convenience classes that don't fit the inheritance model. How come? Well, isn't RectangleShape actually a ConvexShape with 4 points that are distributed in a particular manner? Circle also?

This is why C# isn't working to our advantage.

What we have here is one of the real-world-usage-convenience/language-inheritance-limitation clashes, since circle is essentially a ConvexShape with many points, so it gives the illusion of being a circle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment