Пример #1
0
 public void RemoveListener(int eventId, ILBEventHandler handler)
 {
     if (id2HandlerDict.TryGetValue(eventId, out HashSet <ILBEventHandler> handlerSet))
     {
         id2HandlerDict[eventId].Remove(handler);
     }
 }
Пример #2
0
 public void AddListener(int eventId, ILBEventHandler handler)
 {
     if (!id2HandlerDict.TryGetValue(eventId, out HashSet <ILBEventHandler> handlerSet))
     {
         handlerSet = id2HandlerDict[eventId] = new HashSet <ILBEventHandler>();
     }
     handlerSet.Add(handler);
 }