예제 #1
0
 public void RemoveObject(AGameObject gameObject)
 {
     if (_gameObjects.Contains(gameObject))
     {
         _gameObjects.Remove(gameObject);
     }
 }
예제 #2
0
 public void AddObject(AGameObject newGameObject)
 {
     if (!IsCorrectLocation(newGameObject.Location))
     {
         throw new ArgumentException();
     }
     _gameObjects.Add(newGameObject);
     if (!(newGameObject is AFish fish))
     {
         return;
     }
     fish.OnDie += RemoveObject;
 }