示例#1
0
        static void Main(string[] args)
        {
            PokeBag pokeBag = new PokeBag();

            Pikachu    pikachu1   = new Pikachu();
            Pikachu    pikachu2   = new Pikachu();
            Bubasaur   bubasaur1  = new Bubasaur();
            Bubasaur   bubasaur2  = new Bubasaur();
            Charmander charmander = new Charmander();

            pokeBag.Add(pikachu1);
            pokeBag.Add(pikachu2);
            pokeBag.Add(bubasaur1);
            pokeBag.Add(bubasaur2);
            pokeBag.Add(charmander);

            pokeBag.Speak();
            pokeBag.GetStrongest();
        }
示例#2
0
        static void Main(string[] args)
        {
            Pikachu    pikachu    = new Pikachu();
            Bulbasaur  bulbasaur  = new Bulbasaur();
            Charmander charmander = new Charmander();

            PokemonBag pokemonBag = new PokemonBag();

            pokemonBag.pokeBag.Add(new Pikachu());
            pokemonBag.pokeBag.Add(new Pikachu());
            pokemonBag.pokeBag.Add(new Pikachu());
            pokemonBag.pokeBag.Add(new Bulbasaur());
            pokemonBag.pokeBag.Add(new Charmander());

            Console.WriteLine(pokemonBag.pokeBag[0].Speak(pikachu));

            string strongestPokemon = pokemonBag.GetStrongest();

            Console.WriteLine(strongestPokemon);
            Console.ReadLine();
        }