The event system as it is right now is far from being sophisticated, in fact it is only 2 simple arrays of lists of eventhandlers (one array for normal events, one for recurring ones, one list for every event type).
Here's the event handler interface:
class EventHandler
{
protected:
virtual void handleEvents(int eventType,
const EventDataList& events) =0;
};The problem with that is because most handlers handle more than one event type, I have to do tedious event type checks in almost every EventHandler instance - and I know there must be a better way! ...TEMPLATES TO THE RESCUE!!So guess what I did try first - yes, I thought "Let's make handleEvents a template, use the event type as template parameter and specialize that in subclasses - means one function for every event type." -- utter fail! templates can only be used on non-virtual functions.
Time for plan B... ...tomorrow!