public AreaStats Clone() { AreaStats areaStats = new AreaStats() { ID = this.ID, Cassette = this.Cassette }; for (int index = 0; index < this.Modes.Length; ++index) { areaStats.Modes[index] = this.Modes[index].Clone(); } return(areaStats); }
public Session(AreaKey area, string checkpoint = null, AreaStats oldStats = null) : this() { this.Area = area; this.StartCheckpoint = checkpoint; this.ColorGrade = this.MapData.Data.ColorGrade; this.Dreaming = AreaData.Areas[area.ID].Dreaming; //this.Inventory = AreaData.GetCheckpointInventory(area, checkpoint); this.CoreMode = AreaData.Areas[area.ID].CoreMode; this.FirstLevel = true; //this.Audio = this.MapData.ModeData.AudioState.Clone(); if (this.StartCheckpoint == null) { this.Level = this.MapData.StartLevel().Name; this.StartedFromBeginning = true; } else { this.Level = this.StartCheckpoint; this.StartedFromBeginning = false; this.Dreaming = AreaData.GetCheckpointDreaming(area, checkpoint); this.CoreMode = AreaData.GetCheckpointCoreMode(area, checkpoint); //AudioState checkpointAudioState = AreaData.GetCheckpointAudioState(area, checkpoint); //if (checkpointAudioState != null) //{ // if (checkpointAudioState.Music != null) // this.Audio.Music = checkpointAudioState.Music.Clone(); // if (checkpointAudioState.Ambience != null) // this.Audio.Ambience = checkpointAudioState.Ambience.Clone(); //} string checkpointColorGrading = AreaData.GetCheckpointColorGrading(area, checkpoint); if (checkpointColorGrading != null) { this.ColorGrade = checkpointColorGrading; } CheckpointData checkpoint1 = AreaData.GetCheckpoint(area, checkpoint); if (checkpoint1 != null && checkpoint1.Flags != null) { foreach (string flag in checkpoint1.Flags) { this.SetFlag(flag, true); } } } //if (oldStats != null) // this.OldStats = oldStats; //else // this.OldStats = SaveData.Instance.Areas[this.Area.ID].Clone(); }