Beispiel #1
0
 public void Add(string name, BSActor actor)
 {
     lock (m_actors)
     {
         if (!m_actors.ContainsKey(name))
         {
             m_actors[name] = actor;
         }
     }
 }
Beispiel #2
0
 public void Add(string name, BSActor actor)
 {
     lock (m_actors)
     {
         if (!m_actors.ContainsKey(name))
         {
             m_actors[name] = actor;
         }
     }
 }
Beispiel #3
0
 public bool TryGetActor(string actorName, out BSActor theActor)
 {
     m_actorsRwLock.AcquireReaderLock(-1);
     try
     {
         return(m_actors.TryGetValue(actorName, out theActor));
     }
     finally
     {
         m_actorsRwLock.ReleaseReaderLock();
     }
 }
Beispiel #4
0
 public void Add(string name, BSActor actor)
 {
     m_actorsRwLock.AcquireWriterLock(-1);
     try
     {
         if (!m_actors.ContainsKey(name))
         {
             m_actors[name] = actor;
         }
     }
     finally
     {
         m_actorsRwLock.ReleaseWriterLock();
     }
 }
Beispiel #5
0
        public bool RemoveAndRelease(string name)
        {
            bool ret = false;

            lock (m_actors)
            {
                if (m_actors.ContainsKey(name))
                {
                    BSActor beingRemoved = m_actors[name];
                    m_actors.Remove(name);
                    beingRemoved.Dispose();
                    ret = true;
                }
            }
            return(ret);
        }
Beispiel #6
0
        public bool RemoveAndRelease(string name)
        {
            bool ret = false;

            m_actorsRwLock.AcquireWriterLock(-1);
            try
            {
                if (m_actors.ContainsKey(name))
                {
                    BSActor beingRemoved = m_actors[name];
                    m_actors.Remove(name);
                    beingRemoved.Dispose();
                    ret = true;
                }
            }
            finally
            {
                m_actorsRwLock.ReleaseWriterLock();
            }
            return(ret);
        }
Beispiel #7
0
 public bool TryGetActor(string actorName, out BSActor theActor)
 {
     return m_actors.TryGetValue(actorName, out theActor);
 }
Beispiel #8
0
 public void Add(string name, BSActor actor)
 {
     m_actors[name] = actor;
 }
Beispiel #9
0
 public bool TryGetActor(string actorName, out BSActor theActor)
 {
     return(m_actors.TryGetValue(actorName, out theActor));
 }
Beispiel #10
0
 public void Add(string name, BSActor actor)
 {
     m_actors[name] = actor;
 }