   Practicality of my Event Handling Design
  Just looking for some comments on how my system is going to be designed and maybe some tips to improve it.First off, there are events.Events consist of a list of arguments ( Variant structs that have a type value enumeration, data corresponding to the type specified and a hashed string key id)a timestamp (when the event was created) and a float value for execution delay of the event.Objects themselves that handle events will have their interface class with a virtual OnEvent(Event & evnt) function. Components of the rest of the engine architecture will hold an EventStation object. This object is responsible for passing events created in its component to the event manager, as well as retrieving events from the manager and handing them to objects.The manager itself holds a map of event key values and lists of event stations for subscription data. As well as a list of events waiting to be handled.Any suggestions to simplify this system?As it stands here is the code my manager uses to dispatch events to stations.void Tick(float deltaTime){for(std::list<CEventData*>::iterator i = eventList.begin(); i != eventList.end(); ++i){if((*i)->Tick(deltaTime))//returns true if event if past event delay timer{//broadcast event to subscribed systemsstd::map<unsigned long, std::list<CEventStation*>>::iterator ii = subscriptions.find((*i)->RetrieveKey());if(ii != subscriptions.end()){//found subscribed stationfor(std::list<CEventStation*>::iterator iii = (*ii).second.begin(); iii != (*ii).second.end(); ++iii){//dispatch eventDispatch((*i), (*iii));}}}}}
  All your events seem to be time-based, but you don't remove the event once it's been triggered, even though it's impossible for it to trigger again.  Is this something you're doing that you just didn't post?  Or is there some mechanism by which events can be triggered again?Also, if you sort your events by when they're supposed to be triggered in absolute time, you only ever need to check the first event in the list -- if it hasn't been triggered yet, then its impossible for any of the other events that occur after it to be triggered either.  Likewise, it it does trigger, then you only need to check down the list until you find the first event that doesn't trigger.  This will also allow you to get rid of your Tick() function, since each event can store its absolute trigger time and a delay doesn't have to be decremented for every event in the list.I suppose that if your goal is time-delayed events only, then once you take into account my above suggestions the system would work fine.  But do you eventually want events to be triggered arbitrarily, and more than once?   ;  actually right after the post I realized I wasn't removing events and addeddelete (*i);i = --eventList.erase(i);at the end of the if check.I was also debating changing from a list of events to a priority queue that used absolute trigger time as its priority level but was having issues setting up that container with my event class.That way I could just iterate until an event that isn't triggered yet is found.   