예제 #1
0
 public void Remove(MineObject mine)
 {
     using (_mineLock.ObtainUpgradeableReadLock()) {
         if (_mines.ContainsKey(mine.ID))
         {
             using (_mineLock.ObtainWriteLock()) {
                 _mines.Remove(mine.ID);
             }
         }
     }
 }
예제 #2
0
 public void Add(MineObject mine)
 {
     using (_mineLock.ObtainUpgradeableReadLock()) {
         if (!_mines.ContainsKey(mine.ID))
         {
             using (_mineLock.ObtainWriteLock()) {
                 _mines.Add(mine.ID, mine);
             }
         }
     }
 }
 public bool TryRemoveMine(MineObject mine)
 {
     lock (_checkMinesInRange) {
         return(_renderedMines.Remove(mine.ID));
     }
 }