예제 #1
0
 public static void Regist(ActionEventTypes type, Action <ICharacterable> handler)
 {
     if (actionEventHandlers.ContainsKey(type))
     {
         actionEventHandlers[type] += handler;
     }
     else
     {
         actionEventHandlers.Add(type, handler);
     }
 }
예제 #2
0
        public static void Dispatch(ActionEventTypes type, ICharacterable characterable)
        {
            Action <ICharacterable> result;

            if (actionEventHandlers.TryGetValue(type, out result))
            {
                if (null == result)
                {
                    return;
                }

                result(characterable);
            }
        }
예제 #3
0
 public static void Remove(ActionEventTypes type, Action <ICharacterable> handler)
 {
     actionEventHandlers[type] -= handler;
 }