示例#1
0
    public IEnumerator GenerateWeatherMap(
        int width,
        int height,
        float xOffset,
        float yOffset,
        TemperatureParameter para,
        IReturn <float[]> ret)
    {
        _width  = width;
        _height = height;
        _para   = para;

        _temperatureMap = new float[_width * _height];

        var weatherMonad = new BlockMonad <float[]>(r =>
                                                    _weatherGen.GenerateWeatherMap(_width, _height, xOffset, yOffset, _para.WEATHER_GEN_PARA, r));

        yield return(weatherMonad.Do());

        _varietyStatus = _weatherGen.VarietyStatus;
        var varietyMap = weatherMonad.Result;

        _GenerateMainTemperature(varietyMap);

        ret.Accept(_temperatureMap);
    }
    public IEnumerator GenerateWeatherMap(
        int width,
        int height,
        float xOffset,
        float yOffset,
        WeatherParameter para,
        IReturn <float[]> ret)
    {
        _width  = width;
        _height = height;
        _para   = para;

        _varietyStatus = new WeatherVarietyStatus(xOffset, yOffset);

        _weatherMap = new float[_width * _height];

        yield return(_GenerateWeatherMap());

        ret.Accept(_weatherMap);
    }