Esempio n. 1
0
        protected object MigrateFromVersion3(object oldConfig)
        {
            ConfigurationV3 config    = (ConfigurationV3)oldConfig;
            ConfigurationV4 newConfig = new ConfigurationV4();

            newConfig.SoundPackPreset   = config.SoundPackPreset;
            newConfig.ExtraDebugLogging = config.ExtraDebugLogging;
            foreach (var kvp in config.AmbientSounds)
            {
                newConfig.AmbientSounds.Add(kvp.Key, new ConfigurationV4.Sound()
                {
                    SoundPack = kvp.Value.Active, Volume = kvp.Value.Volume
                });
            }
            foreach (var kvp in config.AnimalSounds)
            {
                newConfig.AnimalSounds.Add(kvp.Key, new ConfigurationV4.Sound()
                {
                    SoundPack = kvp.Value.Active, Volume = kvp.Value.Volume
                });
            }
            foreach (var kvp in config.BuildingSounds)
            {
                newConfig.BuildingSounds.Add(kvp.Key, new ConfigurationV4.Sound()
                {
                    SoundPack = kvp.Value.Active, Volume = kvp.Value.Volume
                });
            }
            foreach (var kvp in config.VehicleSounds)
            {
                newConfig.VehicleSounds.Add(kvp.Key, new ConfigurationV4.Sound()
                {
                    SoundPack = kvp.Value.Active, Volume = kvp.Value.Volume
                });
            }
            foreach (var kvp in config.MiscSounds)
            {
                newConfig.MiscSounds.Add(kvp.Key, new ConfigurationV4.Sound()
                {
                    SoundPack = kvp.Value.Active, Volume = kvp.Value.Volume
                });
            }

            return(newConfig);
        }
Esempio n. 2
0
        protected object MigrateFromVersion2(object oldConfig)
        {
            ConfigurationV2 config    = (ConfigurationV2)oldConfig;
            ConfigurationV3 newConfig = new ConfigurationV3();

            newConfig.ExtraDebugLogging = config.ExtraDebugLogging;
            foreach (var kvp in config.AmbientVolumes)
            {
                newConfig.AmbientSounds.Add(kvp.Key, new ConfigurationV3.Sound()
                {
                    Volume = kvp.Value
                });
            }
            foreach (var kvp in config.AnimalVolumes)
            {
                newConfig.AnimalSounds.Add(kvp.Key, new ConfigurationV3.Sound()
                {
                    Volume = kvp.Value
                });
            }
            foreach (var kvp in config.BuildingVolumes)
            {
                newConfig.BuildingSounds.Add(kvp.Key, new ConfigurationV3.Sound()
                {
                    Volume = kvp.Value
                });
            }
            foreach (var kvp in config.VehicleVolumes)
            {
                newConfig.VehicleSounds.Add(kvp.Key, new ConfigurationV3.Sound()
                {
                    Volume = kvp.Value
                });
            }
            foreach (var kvp in config.MiscVolumes)
            {
                newConfig.MiscSounds.Add(kvp.Key, new ConfigurationV3.Sound()
                {
                    Volume = kvp.Value
                });
            }

            return(newConfig);
        }