public boolean rangeHasObstacle(Position P, int rayon){
        int x0 = P.getX();
        int y0 = P.getY();
        for(int x = -rayon; x < rayon; x++){
            for(int y = -rayon; y < rayon; y++){
                if(x0+x<IConfig.LARGEUR_CARTE && y0+y<IConfig.HAUTEUR_CARTE && x0+x>=0 && y0+y>=0)
                    if(map[x0+x][y0+y].getType()== BackgroundEnum.forest 
                        || map[x0+x][y0+y].getType()== BackgroundEnum.mountain 
                        || map[x0+x][y0+y].getType()== BackgroundEnum.water)
                        return true;
            } 
        }
        return false;
    }