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(); }
public static Session.CoreModes GetCheckpointCoreMode(AreaKey area, string level) { CheckpointData checkpoint = AreaData.GetCheckpoint(area, level); return(checkpoint != null && checkpoint.CoreMode.HasValue ? checkpoint.CoreMode.Value : AreaData.Areas[area.ID].CoreMode); }
public static string GetCheckpointColorGrading(AreaKey area, string level) { return(AreaData.GetCheckpoint(area, level)?.ColorGrade); }
public static bool GetCheckpointDreaming(AreaKey area, string level) { CheckpointData checkpoint = AreaData.GetCheckpoint(area, level); return(checkpoint != null ? checkpoint.Dreaming : AreaData.Areas[area.ID].Dreaming); }