this is what I want to be able to do: (pseudo code)
class DerivedClass : public BaseClass
{
public Draw()
{
BaseClass.Draw()
}
}
class BaseClass
{
protected Draw();
}
Both draws have the same name and the same signature. The reason for wanting to do this is that sometimes I want my derived classes to have a draw function that simply calls the Base Classes draw, but at other times I want the derived class to choose when to call the base draw function or not. This meant that I can keep the class that I instantiate the derived classes in much cleaner, and can just call draw on all of them at all times. The derived classes themselves handle the nitty-gritty.
What exactly is the syntax for the BaseClass.Draw
part? I thought you could actually just write that as it is, but the compiler is complaining, and it's not like I can just call Draw
because the signatures are the same.
The syntax is BaseClass::Draw()
.
The syntax is
DeriveClass::Draw()
{
BaseClass::Draw();
}
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