public static void Unregister(LogicEventType type, LogicEventListener toUnregister) { LogicEventListener listener = null; if (listeners.TryGetValue(type, out listener) == true) { listener -= toUnregister; } }
public static void RaiseEvent(LogicEventType type, object userData) { LogicEventListener listener = null; if (listeners.TryGetValue(type, out listener) && listener != null) { listener(userData); } }
public static void Register(LogicEventType type, LogicEventListener toRegister) { LogicEventListener listener = null; if (listeners.TryGetValue(type, out listener) == false) { listeners.Add(type, toRegister); } else { listener += toRegister; } }