src/Controller/controllerOperation.cpp
/**
 * Do click block operation on specific block.
 * @param x
 * @param y
 */
Do click block operation on specific block.
@param x
@param y
Do click block operation on specific block . @param x @param y
void Controller::Controller::click(uint16_t x, uint16_t y) {
    if (isOut(x, y) || (*this->getShowedField()->GetMap())[x][y] == MapGenerator::BLOCKTYPE::FLAGGED)
        return;
    if (isClickedMine(x, y))   
        finishGame(false);
    recursionClick(x, y);
    if (getMineField()->GetMines() == getShowedField()->GetMines()) {
        this->showMap();    
        finishGame(true);
    }
}
void Controller :: Controller :: click ( uint16_t x , uint16_t y ) { if ( isOut ( x , y ) || ( * this -> getShowedField ( ) -> GetMap ( ) ) [ x ] [ y ] == MapGenerator :: BLOCKTYPE :: FLAGGED ) return ; if ( isClickedMine ( x , y ) ) finishGame ( false ) ; recursionClick ( x , y ) ; if ( getMineField ( ) -> GetMines ( ) == getShowedField ( ) -> GetMines ( ) ) { this -> showMap ( ) ; finishGame ( true ) ; } }
Do click block operation on specific block.
Do click block operation on specific block .
// clicked on mine. // recalculate unrevealed block here. /* if meet this condition, player win. */ // show map before end this game.