public MapData(AreaKey area) { this.Area = area; this.Data = AreaData.Areas[this.Area.ID]; this.ModeData = this.Data.Mode[(int)this.Area.Mode]; this.Load(); }
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 CheckpointData GetCheckpoint(AreaKey area, string level) { CheckpointData[] checkpoints = AreaData.Areas[area.ID].Mode[(int)area.Mode].Checkpoints; if (level != null && checkpoints != null) { foreach (CheckpointData checkpointData in checkpoints) { if (checkpointData.Level.Equals(level)) { return(checkpointData); } } } return((CheckpointData)null); }
public static string GetCheckpointColorGrading(AreaKey area, string level) { return(AreaData.GetCheckpoint(area, level)?.ColorGrade); }
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 bool GetCheckpointDreaming(AreaKey area, string level) { CheckpointData checkpoint = AreaData.GetCheckpoint(area, level); return(checkpoint != null ? checkpoint.Dreaming : AreaData.Areas[area.ID].Dreaming); }