public static void DispatchEvent(IGameEvent gameEvent) { Type type = gameEvent.GetType(); if (!events.ContainsKey(type) || events[type] == null) { return; } HashSet <IInvoker> invokeList = events[type]; foreach (var invoke in invokeList) { invoke.Invoke(gameEvent); } gameEvent.Reset(); }