Exemple #1
0
        static void addOddish()
        {
            Pokemon oddish = new Oddish();

            Console.Write("NAME: ");
            oddish.Name = Console.ReadLine();
            oddish.setType();
            oddish.checkConditions();
            listPokemon.Add(oddish);
        }
Exemple #2
0
        static void showSound()
        {
            Oddish    oddish    = new Oddish();
            Bulbasaur bulbasaur = new Bulbasaur();
            Pikachu   pikachu   = new Pikachu();
            int       size      = listPokemon.Count;

            for (int i = 0; i < size; i++)
            {
                if (listPokemon[i].GetType().Equals(oddish.GetType()))
                {
                    listPokemon[i].Sound();
                }
                if (listPokemon[i].GetType().Equals(bulbasaur.GetType()))
                {
                    listPokemon[i].Sound();
                }
                if (listPokemon[i].GetType().Equals(pikachu.GetType()))
                {
                    listPokemon[i].Sound();
                }
            }
        }