Пример #1
0
        public PokemonModel(PokemonId id)
        {
            PokemonSettings pokeman = GameClient.GetExtraDataForPokemon(id);

            BuildFromSettings(pokeman);

            PokedexEntry pokedexEntry = GameClient.PokedexInventory.FirstOrDefault(x => x.PokemonId == id);

            BuildFromPokedexEntry(pokedexEntry);

            PokemonModel pokemonModel = new PokemonModel(pokeman, pokedexEntry);

            var CurrPokemon = pokemonModel;

            Evolutions.Add(pokemonModel);
            while (CurrPokemon.ParentPokemonId != PokemonId.Missingno)
            {
                var insertme = FromId(CurrPokemon.ParentPokemonId);
                Evolutions.Insert(0, insertme);
                CurrPokemon = FromId(CurrPokemon.ParentPokemonId);
            }
            CurrPokemon = pokemonModel;
            while (CurrPokemon.EvolutionIds.Count > 0)
            {
                foreach (PokemonId ev in CurrPokemon.EvolutionIds)
                {
                    var addme = FromId(ev);
                    Evolutions.Add(addme);
                }
                CurrPokemon = new PokemonModel(CurrPokemon.EvolutionIds.ElementAt(0));
            }

            if (TimesCaptured == 0 && Id == PokemonId.Poliwag)
            {
                Debug.WriteLine(Name);
            }
        }