public static string GetNextLevel(string current) { if (current == StartingLevel) { return(FirstPuzzleLevel()); } if (current == LastPuzzleLevel()) { Mod.Logger.Log("Last level: " + current); return(EndingLevel); } if (!ShuffledPuzzleLevels.Contains(current)) { Mod.Logger.Log("Unable to find next level from " + current); return(current); } int idx = ShuffledPuzzleLevels.IndexOf(current); idx++; return(ShuffledPuzzleLevels[idx]); }
public static string GetPrevLevel(string current) { if (current == FirstPuzzleLevel()) { return(StartingLevel); } if (current == EndingLevel) { return(LastPuzzleLevel()); } if (!ShuffledPuzzleLevels.Contains(current)) { Mod.Logger.Log("Unable to find previous level from " + current); return(current); } int idx = ShuffledPuzzleLevels.IndexOf(current); idx--; return(ShuffledPuzzleLevels[idx]); }