Exemple #1
0
        protected object MigrateFromVersion0(object oldConfig)
        {
            ConfigurationV0 config    = (ConfigurationV0)oldConfig;
            ConfigurationV1 newConfig = new ConfigurationV1();

            newConfig.ExtraDebugLogging = config.ExtraDebugLogging;
            foreach (var kvp in config.State.AmbientVolumes)
            {
                newConfig.AmbientVolumes.Add(kvp.Key, kvp.Value);
            }
            foreach (var kvp in config.State.EffectVolumes)
            {
                newConfig.VehicleVolumes.Add(kvp.Key, kvp.Value);
            }

            return(newConfig);
        }
Exemple #2
0
        protected object MigrateFromVersion1(object oldConfig)
        {
            ConfigurationV1 config    = (ConfigurationV1)oldConfig;
            ConfigurationV2 newConfig = new ConfigurationV2();

            newConfig.ExtraDebugLogging = config.ExtraDebugLogging;
            foreach (var kvp in config.AmbientVolumes)
            {
                newConfig.AmbientVolumes.Add(kvp.Key, kvp.Value);
            }
            foreach (var kvp in config.AnimalVolumes)
            {
                newConfig.AnimalVolumes.Add(kvp.Key, kvp.Value);
            }
            foreach (var kvp in config.BuildingVolumes)
            {
                newConfig.BuildingVolumes.Add(kvp.Key, kvp.Value);
            }
            foreach (var kvp in config.VehicleVolumes)
            {
                switch (kvp.Key)
                {
                case "Small Car Movement":
                    newConfig.VehicleVolumes.Add("Small Car Sound", kvp.Value);
                    break;

                case "Large Car Movement":
                    newConfig.VehicleVolumes.Add("Large Car Sound", kvp.Value);
                    break;

                default:
                    newConfig.VehicleVolumes.Add(kvp.Key, kvp.Value);
                    break;
                }
            }
            foreach (var kvp in config.MiscVolumes)
            {
                newConfig.MiscVolumes.Add(kvp.Key, kvp.Value);
            }

            return(newConfig);
        }