game.cpp
void Game::encounter()
{
    if(arrows == 0 && wumpus == false)
    {
        cout << arrow1 << "\n\n";
        //return false;
    }
    else if(arrows == 0 && wumpus == true)
    {
        cout << arrow2 << "\n\n";
    }
    
    switch (grid[player_x][player_y].get_event_type())
    {
    case 1:
        
        break;
    case 2:
        cout << grid[player_x][player_y].get_in() << "\n\n";
        
        alive = false;
        //return false;
        break;
    case 3:
        cout << grid[player_x][player_y].get_in() << "\n\n";
        gold = true;
        grid[player_x][player_y].set_player(false);
        grid[player_x][player_y].set_player(true);
        grid[player_x][player_y].set_event_type(1);
        //remove(player_x,player_y);
        //return true;
        break;
    case 4: 
        cout << grid[player_x][player_y].get_in() << "\n\n";
        alive = false;
        //return false;
        break;
    case 5:
        cout << grid[player_x][player_y].get_in() << "\n\n";
        bat_move();
        //return true;
        break;
    
    default:
        break;
    }
    //return true;
}
/*********************************************************************
** Function: encounter
** Description: this function prints out the events near the player
** Parameters: none
** Pre-Conditions: the position of the player at the moment
** Post-Conditions: none
*********************************************************************/
encounter
Description: this function prints out the events near the player
Parameters: none
Pre-Conditions: the position of the player at the moment
Post-Conditions: none
encounter Description : this function prints out the events near the player Parameters : none Pre - Conditions : the position of the player at the moment Post - Conditions : none
void Game::encounter()
{
    if(arrows == 0 && wumpus == false)
    {
        cout << arrow1 << "\n\n";
    }
    else if(arrows == 0 && wumpus == true)
    {
        cout << arrow2 << "\n\n";
    }
    switch (grid[player_x][player_y].get_event_type())
    {
    case 1:
        break;
    case 2:
        cout << grid[player_x][player_y].get_in() << "\n\n";
        alive = false;
        break;
    case 3:
        cout << grid[player_x][player_y].get_in() << "\n\n";
        gold = true;
        grid[player_x][player_y].set_player(false);
        grid[player_x][player_y].set_player(true);
        grid[player_x][player_y].set_event_type(1);
        break;
    case 4: 
        cout << grid[player_x][player_y].get_in() << "\n\n";
        alive = false;
        break;
    case 5:
        cout << grid[player_x][player_y].get_in() << "\n\n";
        bat_move();
        break;
    default:
        break;
    }
}
void Game :: encounter ( ) { if ( arrows == 0 && wumpus == false ) { cout << arrow1 << " \n \n " ; } else if ( arrows == 0 && wumpus == true ) { cout << arrow2 << " \n \n " ; } switch ( grid [ player_x ] [ player_y ] . get_event_type ( ) ) { case 1 : break ; case 2 : cout << grid [ player_x ] [ player_y ] . get_in ( ) << " \n \n " ; alive = false ; break ; case 3 : cout << grid [ player_x ] [ player_y ] . get_in ( ) << " \n \n " ; gold = true ; grid [ player_x ] [ player_y ] . set_player ( false ) ; grid [ player_x ] [ player_y ] . set_player ( true ) ; grid [ player_x ] [ player_y ] . set_event_type ( 1 ) ; break ; case 4 : cout << grid [ player_x ] [ player_y ] . get_in ( ) << " \n \n " ; alive = false ; break ; case 5 : cout << grid [ player_x ] [ player_y ] . get_in ( ) << " \n \n " ; bat_move ( ) ; break ; default : break ; } }
Function: encounter
Description: this function prints out the events near the player
Parameters: none
Pre-Conditions: the position of the player at the moment
Post-Conditions: none
Function : encounter Description : this function prints out the events near the player Parameters : none Pre - Conditions : the position of the player at the moment Post - Conditions : none
//return false; //return false; //remove(player_x,player_y); //return true; //return false; //return true; //return true;