Example #1
0
    public void handleRequestResponse(string response)
    {
        NOAAWeathers.PointData pointData = JsonUtility.FromJson <NOAAWeathers.PointData> (response);
        NOAAWeathers.NOAAWeatherRequestBuilder builder = new NOAAWeathers.NOAAWeatherRequestBuilder();

        string gridUrl = builder.getUrlForGridPoint(pointData);

        if (requestToResponseMap.ContainsValue(gridUrl))
        {
            handleGridForecast(requestToResponseMap [gridUrl]);
        }
        else
        {
            StartCoroutine(GetGridForecast(gridUrl));
        }

        string pointDataForecastUrl = builder.getUrlForPointForecast(pointData);

        if (requestToResponseMap.ContainsValue(pointDataForecastUrl))
        {
            handlePointForecast(requestToResponseMap [pointDataForecastUrl]);
        }
        else
        {
            StartCoroutine(GetPointForecast(pointDataForecastUrl));
        }
    }