Exemplo n.º 1
0
 /// <summary>
 /// Shoot allows a tile to be shot at, and if the tile has been hit before
 /// it will give an error
 /// </summary>
 internal void Shoot()
 {
     if ((false == Shot))
     {
         Shot = true;
         if (_Ship != null)
         {
             _Ship.Hit();
         }
     }
     else
     {
         throw new ApplicationException("You have already shot this square");
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Shoot allows a tile to be shot at, and if the tile has been hit before
 /// it will give an error
 /// </summary>
 internal void Shoot()
 {
     if (Shot == false)
     {
         Shot = true;
         if (_Ship is object)
         {
             _Ship.Hit();
         }
     }
     else
     {
         throw new ApplicationException("You have already shot this square");
     }
 }