Exemplo n.º 1
0
 public void RemoveObject(AGameObject gameObject)
 {
     if (_gameObjects.Contains(gameObject))
     {
         _gameObjects.Remove(gameObject);
     }
 }
Exemplo n.º 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;
 }