AcManager.Tools.Objects.WeatherObject.LoadExtended C# (CSharp) Method

LoadExtended() private method

private LoadExtended ( IniFile ini ) : void
ini IniFile
return void
        private void LoadExtended(IniFile ini) {
            var clouds = ini["CLOUDS"];
            CloudsCover = clouds.GetDouble("COVER", 0.9);
            CloudsCutoff = clouds.GetDouble("CUTOFF", 0.5);
            CloudsColor = clouds.GetDouble("COLOR", 0.7);
            CloudsWidth = clouds.GetDouble("WIDTH", 9);
            CloudsHeight = clouds.GetDouble("HEIGHT", 4);
            CloudsRadius = clouds.GetDouble("RADIUS", 6);
            CloudsNumber = clouds.GetInt("NUMBER", 40);
            CloudsSpeedMultipler = clouds.GetDouble("BASE_SPEED_MULT", 0.0015) * 100d;

            var fog = ini["FOG"];
            var color = fog.GetStrings("COLOR").Select(x => FlexibleParser.TryParseDouble(x) ?? 1d).ToArray();
            if (color.Length == 3) {
                var maxValue = color.Max();
                if (Equals(maxValue, 0d)) {
                    FogColor = Colors.Black;
                    FogColorMultipler = 100;
                } else {
                    maxValue *= 1.2;
                    if (maxValue >= 0d && maxValue < 1d) {
                        maxValue = 1d;
                    } else if (maxValue < 0d && maxValue > -1d) {
                        maxValue = -1d;
                    }

                    FogColor = Color.FromRgb((255 * color[0] / maxValue).ClampToByte(),
                        (255 * color[1] / maxValue).ClampToByte(),
                        (255 * color[2] / maxValue).ClampToByte());
                    FogColorMultipler = maxValue;
                }
            }

            FogBlend = fog.GetDouble("BLEND", 0.85);
            FogDistance = fog.GetDouble("DISTANCE", 9000);

            ForceCarLights = ini["CAR_LIGHTS"].GetBool("FORCE_ON", false);
        }