public PokéDex() { PokémonInitialization.Initialize(); this.AllPokémon = new List <Pokémon>(); this.AllPokémon.AddRange(PokémonInitialization.preInitPokemonList); for (int i = 0; i < PokémonInitialization.preInitPokemonList.Count; i++) { Pokémon pokémon = PokémonInitialization.preInitPokemonList[i]; if (pokémon.EvolvesFrom != null) { for (int j = 0; j < pokémon.EvolvesFrom.Count; j++) { Pokémon pokémonevofrom = pokémon.EvolvesFrom[j]; this.AllPokémon[i].EvolvesFrom[j] = this.AllPokémon.FirstOrDefault(e => string.Equals(e.SpeciesName, pokémonevofrom.SpeciesName, StringComparison.CurrentCultureIgnoreCase)); } } if (pokémon.EvolvesInto != null) { for (int j = 0; j < pokémon.EvolvesInto.Count; j++) { Pokémon pokémonevofrom = pokémon.EvolvesInto[j]; this.AllPokémon[i].EvolvesInto[j] = this.AllPokémon.FirstOrDefault(e => string.Equals(e.SpeciesName, pokémonevofrom.SpeciesName, StringComparison.CurrentCultureIgnoreCase)); } } } PokémonInitialization.preInitPokemonList.Clear(); InstanceDex = this; }
public static Pokémon PostInitPokémon(string speciesName) { Pokémon mon = new Pokémon { SpeciesName = speciesName.Transform(To.TitleCase) }; if (mon.SpeciesName.ToLower() == "mrmime") { mon.SpeciesName = "Mr. Mime"; } if (mon.SpeciesName.ToLower() == "mimejr") { mon.SpeciesName = "Mime Jr."; } if (mon.SpeciesName.ToLower() == "typenull") { mon.SpeciesName = "Type: Null"; } if (mon.SpeciesName.ToLower() == "hooh") { mon.SpeciesName = "Ho-Oh"; } if (mon.SpeciesName.ToLower() == "hakamoo") { mon.SpeciesName = "Hakamo-o"; } if (mon.SpeciesName.ToLower() == "jangmoo") { mon.SpeciesName = "Jangmo-o"; } if (mon.SpeciesName.ToLower() == "kommoo") { mon.SpeciesName = "Kommo-o"; } if (mon.SpeciesName.ToLower() == "porygonz") { mon.SpeciesName = "Porygon-Z"; } if (mon.SpeciesName.Contains('-', '.', ':')) { //IUserMessage _ = Program.Client.GetUser(228019100008316948).GetOrCreateDMChannelAsync().Result.SendMessageAsync($"Pokémon {mon.SpeciesName} not parsed!").Result; } return(mon); }