Pretty straightforward question. Say I have a base class and a derived class. Is it possible to create a function in the base class and explicitly prevent the derived class from overriding it? I know I can do the opposite (force the derived class to override) with a pure virtual function, but have never heard of a way to do this.
It's not purely necessary, seeing as I can just *not* override it, but I prefer to make things explicit where possible.
For context: Basically I have a Main_Controller class whose job it is primarily to do event handling. This is all fine and good, but I find in my game I have two fairly distinct user interfaces when it comes to hotkeys. One is related to the world map, towns, explorable areas, etc. The other is specific to battles and the battleMap. So rather than having two distinct event handlers in one class I thought it would be a lot more flexible to create a base Controller class, and then derive Main_Controller and a Battle_Controller from it. When a battle began I would then pass off control to the Battle_Controller class.
However, there are some gui events (game options menu type stuff) I would like to ensure are being handled the same way in each. It seems the most obvious way is to ensure that both derived classes are using the base class function for handling these particular events.