private void UnflagSquare(int row, int col) { board[row, col].IsFlagged = false; if (board[row, col].IsMine) { correctlyFlaggedMines--; } flaggedSquares--; SquareUnflagged.Raise(this, new SquareEventArgs(row, col)); }
private bool RevealEmptySquare(int row, int col) { if (board[row, col].IsRevealed) { return(false); } board[row, col].IsRevealed = true; if (board[row, col].IsFlagged) { board[row, col].IsFlagged = false; SquareUnflagged.Raise(this, new SquareEventArgs(row, col)); } SafeSquareRevealed.Raise(this, new SquareEventArgs(row, col, board[row, col].AdjacentMines)); if (board[row, col].AdjacentMines == 0) { return(true); } return(false); }