Beispiel #1
0
 public bool AllShippsPlaced()
 {
     return(Ships.All(ship => ship.Placed));
 }
Beispiel #2
0
 public bool IsOver()
 {
     return(Ships.All(s => s.IsSunk()));
 }
Beispiel #3
0
 public bool IsGameOver() => Ships.All(s => s.IsSunk());
Beispiel #4
0
 /// <summary>
 /// Returns a value indicating whether all ships on this board have been sunk.
 /// </summary>
 public bool GetAllShipsSunk()
 {
     return(Ships.All(pair => pair.Value.IsSunk()));
 }
Beispiel #5
0
 public bool AreAllShipsSunk()
 {
     // If any ship is not sunk, the game has not ended.
     return(Ships.All(IsShipSunk));
 }
Beispiel #6
0
 private bool IsGameOver()
 {
     return(Ships.All(s => s.IsSunk));
 }