private void UpdateStatus(int row, int column) { if (HasPlayerWon()) { Status = GameStatus.Player.HasWon; } if (m_MineField.IsMineAt(row, column)) { Status = GameStatus.Player.SelectedFieldWithMine; } }
public string GameStatusToString(GameStatus.Player status) { switch (status) { case GameStatus.Player.SelectedFieldWithMine: return("You hit a mine!"); case GameStatus.Player.SelectedFieldWithoutMine: return("Selected Field Without Mine!"); case GameStatus.Player.HasWon: return("You won!"); default: throw new Exception("Unknown Status: " + m_Manager.Status); } }
internal bool IsGameFinished(GameStatus.Player status) { switch (status) { case GameStatus.Player.SelectedFieldWithMine: m_Console.WriteLine("You hit a mine!"); return(true); case GameStatus.Player.SelectedFieldWithoutMine: return(false); case GameStatus.Player.HasWon: m_Console.WriteLine("You won!"); return(true); default: throw new Exception("Unknown Status: " + m_Manager.Status); } }