private void FireEvent(BaseGameEvent theEvent) { foreach(EventReaction eventReaction in reactionDirectory[theEvent.EventType]) { if(eventReaction(theEvent)) break; } }
public void SendEvent(BaseGameEvent theEvent) { if(reactionDirectory.ContainsKey(theEvent.EventType)) { if(theEvent.Delay == 0) FireEvent(theEvent); else eventQueue.Add(currentTime + theEvent.Delay, theEvent); } }