14.14 isFarToBall

This is simply function which determines if the ball is far away from the agent. A distance threshold of 5 was chosen to represent far or close. The idea here is that if the ball is too far away perhaps the agent should do some other behaviour as to move to the ball would take to long to be relevant. Once again we reference the distance using our distance array :_teamMateDistances[_playerNumber-1]; and please note once again we need to decrement by 1 as _playerNumber starts at 1 but our array indexing starts at 0

bool NaoBehavior::isFarToBall(int _playerNumber,double* _teamMateDistances){

    double distance = _teamMateDistances[_playerNumber-1];

    if(distance > 5){
        return true;
    }
    return false;

}