I'm making a game in C#. I created a base class Shape and seven other classes (Shape1, Shape2, ...) that inherit from Shape. In my main program I keep track of the shape currently in play by using
Shape Current;
Then I randomise its value to be equal to one of the shapes, for example:
Current = new Shape1()
The problem is, after I randomise I want to draw the shape with
Current.Draw()
Each shape has its own Draw function, and I want it to use that function specificly, and not the function in Shape. How can I do that?
Draw()method in theShapeclass using either thevirtualorabstractkeyword?