14.11 isShootingRange

This functions determines if the agent is within some distance threshold away from the opponents goal. The idea here is that if we are close enough to the goal which should just shoot instead of trying to be fancy with passes or dribbling. This is achieved by calculating the distance between ourselves _player and the opponents goal using worldModel->distanceToOppGoal(_player). The threshold here was set to 5, this is arbitrary.

bool NaoBehavior::isShootingRange(VecPosition _player){
    
    double distanceToGoal = worldModel->distanceToOppGoal(_player);

    if(distanceToGoal < 5){
        return true;
    }
    return false;

}