Пример #1
0
        public static List <Tipo> BuscarFraqueza(int numero)
        {
            string tempFraqueza = Pokebase.SelecionarFraquezasPokemon(numero);

            string[]    f         = tempFraqueza.Split('\n');
            List <Tipo> fraquezas = new List <Tipo>();

            for (int i = 0; i < f.Length - 1; i++)
            {
                Tipo fraqueza = new Tipo(f[i]);
                fraquezas.Add(fraqueza);
            }

            return(fraquezas);
        }
Пример #2
0
        public Pokedex()
        {
            string recebePokemons = Pokebase.ListarPokemons();

            string[] pokemonsTemp = recebePokemons.Split('\n');

            for (int i = 0; i < pokemonsTemp.Length - 1; i++)
            {
                string[] tempAtributos = pokemonsTemp[i].Split('#');

                string tempHabilidade = Pokebase.SelecionarHabilidadesPokemon(Convert.ToInt32(tempAtributos[0]));
                string tempCategoria  = Pokebase.SelecionarCategoria(Convert.ToInt32(tempAtributos[0]));
                string tempFraquezas  = Pokebase.SelecionarFraquezasPokemon(Convert.ToInt32(tempAtributos[0]));

                Pokemon tempPokemon = new Pokemon(tempAtributos[0], tempAtributos[1], tempAtributos[2], tempAtributos[3], tempAtributos[4], tempHabilidade, tempFraquezas, tempCategoria);
                pokemons.Add(tempPokemon);
            }
        }