示例#1
0
 private WeatherPreset GetWeatherPreset(uint seed, WeatherPresetType type)
 {
     if (presetLookup == null)
     {
         presetLookup = new Dictionary <WeatherPresetType, WeatherPreset[]>();
     }
     WeatherPreset[] value;
     if (!presetLookup.TryGetValue(type, out value))
     {
         presetLookup.Add(type, value = CacheWeatherPresets(type));
     }
     return(ArrayEx.GetRandom(value, ref seed));
 }
示例#2
0
 public WeatherPreset[] CacheWeatherPresets(WeatherPresetType type)
 {
     return(WeatherPresets.Where((WeatherPreset x) => x.Type == type).ToArray());
 }