Пример #1
0
 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));
 }
Пример #2
0
 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);
 }