public void UpdateFromCopy(Sky copy) { Name = copy.Name; Background = copy.Background; Clouds = new List<string>(copy.Clouds); Layers = new List<SkyLayer>(copy.Layers); for (int i = 0; i < Layers.Count; i++) { Layers[i] = Layers[i].ShallowCopy(); } WindSpeed = copy.WindSpeed; Density = copy.Density; Shadows = copy.Shadows; Stars = copy.Stars; FogDensity = copy.FogDensity; VerticalTiling = copy.VerticalTiling; HorizontalScrolling = copy.HorizontalScrolling; InterLayerVerticalDistance = copy.InterLayerVerticalDistance; InterLayerHorizontalDistance = copy.InterLayerHorizontalDistance; HorizontalDistance = copy.HorizontalDistance; VerticalDistance = copy.VerticalDistance; LayerBaseHeight = copy.LayerBaseHeight; LayerBaseSpacing = copy.LayerBaseSpacing; WindParallax = copy.WindParallax; WindDistance = copy.WindDistance; CloudsParallax = copy.CloudsParallax; FoliageShadows = copy.FoliageShadows; ShadowOpacity = copy.ShadowOpacity; NoPerFaceLayerXOffset = copy.NoPerFaceLayerXOffset; LayerBaseXOffset = copy.LayerBaseXOffset; }
public void UpdateFromCopy(Sky copy) { this.Name = copy.Name; this.Background = copy.Background; this.Clouds = new List<string>((IEnumerable<string>) copy.Clouds); this.Layers = Enumerable.ToList<SkyLayer>(Enumerable.Select<SkyLayer, SkyLayer>((IEnumerable<SkyLayer>) copy.Layers, (Func<SkyLayer, SkyLayer>) (x => x.ShallowCopy()))); this.WindSpeed = copy.WindSpeed; this.Density = copy.Density; this.Shadows = copy.Shadows; this.Stars = copy.Stars; this.FogDensity = copy.FogDensity; this.VerticalTiling = copy.VerticalTiling; this.HorizontalScrolling = copy.HorizontalScrolling; this.InterLayerVerticalDistance = copy.InterLayerVerticalDistance; this.InterLayerHorizontalDistance = copy.InterLayerHorizontalDistance; this.HorizontalDistance = copy.HorizontalDistance; this.VerticalDistance = copy.VerticalDistance; this.LayerBaseHeight = copy.LayerBaseHeight; this.LayerBaseSpacing = copy.LayerBaseSpacing; this.WindParallax = copy.WindParallax; this.WindDistance = copy.WindDistance; this.CloudsParallax = copy.CloudsParallax; this.FoliageShadows = copy.FoliageShadows; this.ShadowOpacity = copy.ShadowOpacity; this.NoPerFaceLayerXOffset = copy.NoPerFaceLayerXOffset; this.LayerBaseXOffset = copy.LayerBaseXOffset; }
public void ChangeSky(Sky sky) { this.levelData.Sky = sky; this.OnSkyChanged(); }
public Sky ShallowCopy() { Sky sky = new Sky(); sky.UpdateFromCopy(this); return sky; }