public static void Regist(ActionEventTypes type, Action <ICharacterable> handler) { if (actionEventHandlers.ContainsKey(type)) { actionEventHandlers[type] += handler; } else { actionEventHandlers.Add(type, handler); } }
public static void Dispatch(ActionEventTypes type, ICharacterable characterable) { Action <ICharacterable> result; if (actionEventHandlers.TryGetValue(type, out result)) { if (null == result) { return; } result(characterable); } }
public static void Remove(ActionEventTypes type, Action <ICharacterable> handler) { actionEventHandlers[type] -= handler; }