Good example is a method virtual int getNumber() = 0;
from class DynamicObject
. It, moreover, should be made constant (like virtual int getNumber() const = 0;
), because this method can be override in the descendant class. And if it is overridden in a way that changes the state of the object, it will break the semantics.
The same applies to the methods of the descendant class. For example int Player::getNumber();
should be
int Player::getNumber() const;
.