src/Controller/controllerOperation.cpp
/**
 * Receive and parse command and convert it to valid operation.
 * @param command
 * Int value, except a int value which can be converted to char.
 */
Receive and parse command and convert it to valid operation.
@param command
Int value, except a int value which can be converted to char.
Receive and parse command and convert it to valid operation . @param command Int value except a int value which can be converted to char .
void Controller::Controller::SendCmd(int command) {
    switch (command) {
        case '1':   
            this->click();
            break;
        case '2':   
            this->flag();
            break;
        case '3':   
            this->question();
            break;
        case 75:
        case 'h':   
        case 'a':
            this->curLeftMov();
            break;
        case 80:
        case 'j':   
        case 's':
            this->curDownMov();
            break;
        case 72:
        case 'k':   
        case 'w':
            this->curUpMov();
            break;
        case 77:
        case 'l':   
        case 'd':
            this->curRightMov();
            break;
        case 'z':   
            this->hint();
            break;
        default:;
    }
    this->showMap();
    this->showCursor();
}
void Controller :: Controller :: SendCmd ( int command ) { switch ( command ) { case ' ' : this -> click ( ) ; break ; case ' ' : this -> flag ( ) ; break ; case ' ' : this -> question ( ) ; break ; case 75 : case ' ' : case ' ' : this -> curLeftMov ( ) ; break ; case 80 : case ' ' : case ' ' : this -> curDownMov ( ) ; break ; case 72 : case ' ' : case ' ' : this -> curUpMov ( ) ; break ; case 77 : case ' ' : case ' ' : this -> curRightMov ( ) ; break ; case ' ' : this -> hint ( ) ; break ; default : ; } this -> showMap ( ) ; this -> showCursor ( ) ; }
Receive and parse command and convert it to valid operation.
Receive and parse command and convert it to valid operation .
// click block // flag block // question block // left move cursor // down move cursor // up move cursor // right move cursor // hint this block;