static void addOddish() { Pokemon oddish = new Oddish(); Console.Write("NAME: "); oddish.Name = Console.ReadLine(); oddish.setType(); oddish.checkConditions(); listPokemon.Add(oddish); }
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(); } } }