コード例 #1
0
 public bool AllShippsPlaced()
 {
     return(Ships.All(ship => ship.Placed));
 }
コード例 #2
0
 public bool IsOver()
 {
     return(Ships.All(s => s.IsSunk()));
 }
コード例 #3
0
ファイル: GameState.cs プロジェクト: grzechu01/battleships
 public bool IsGameOver() => Ships.All(s => s.IsSunk());
コード例 #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()));
 }
コード例 #5
0
 public bool AreAllShipsSunk()
 {
     // If any ship is not sunk, the game has not ended.
     return(Ships.All(IsShipSunk));
 }
コード例 #6
0
 private bool IsGameOver()
 {
     return(Ships.All(s => s.IsSunk));
 }