Beispiel #1
0
 private bool Unsubscribe(string id, out TriggerSubscriber obj)
 {
     if (m_Subscribers.TryRemove(id, out obj))
     {
         return(true);
     }
     return(false);
 }
Beispiel #2
0
 private bool Subscribe(NebulaObject obj, out TriggerSubscriber subscriber)
 {
     if (!m_Subscribers.ContainsKey(obj.Id))
     {
         subscriber = new TriggerSubscriber(obj, 0);
         if (m_Subscribers.TryAdd(obj.Id, subscriber))
         {
             return(true);
         }
     }
     subscriber = null;
     return(false);
 }