private void LoadExtraInstructions(List <string> lines) { for (var i = 0; i < lines.Count; i++) { var line = lines[i]; var split = line.Split(ExtraSplitter, 0); if (split.Length != 2) { continue; } var type = split[0]; var value = split[1]; switch (type) { case "Ball": Ball = Aesthetics.GetBallFromString(value); break; case "Shiny": ShinyType = Aesthetics.GetShinyType(value); if (ShinyType != Core.Shiny.Random) { Shiny = ShinyType != Core.Shiny.Never; } break; default: continue; } // Remove from lines lines.RemoveAt(i--); } }
public bool SetRegenSettings(IEnumerable <string> lines) { var split = RegenUtil.Split(lines); bool any = false; foreach (var s in split) { var key = s.Key; var value = s.Value; switch (key) { case nameof(Ball): Ball = Aesthetics.GetBallFromString(value); break; case nameof(Shiny): ShinyType = Aesthetics.GetShinyType(value); break; case nameof(Language): Language = Aesthetics.GetLanguageId(value); break; default: continue; } any = true; } return(any); }
public bool SetRegenSettings(IEnumerable <string> lines) { var split = RegenUtil.Split(lines); bool any = false; foreach (var s in split) { var key = s.Key; var value = s.Value; switch (key) { case nameof(Ball): Ball = Aesthetics.GetBallFromString(value); break; case nameof(Shiny): ShinyType = Aesthetics.GetShinyType(value); break; case nameof(Language): Language = Aesthetics.GetLanguageId(value); break; case nameof(Ability): Ability = Enum.TryParse(value, out AbilityRequest ar) ? ar : AbilityRequest.Any; break; case nameof(Alpha): Alpha = value == "Yes"; break; default: continue; } any = true; } return(any); }