Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Animals <Pet> pets = new Animals <Pet>();

            pets.AddItem(new Dog()
            {
                Name = "Robo", Breed = "Kolli"
            });
            pets.AddItem(new Dog()
            {
                Name = "Tobo", Breed = "Setter"
            });
            pets.AddItem(new Dog()
            {
                Name = "Hobo", Breed = "Shephard"
            });
            pets.AddItem(new Cat()
            {
                Name = "Tom", Breed = "Kat1"
            });
            pets.AddItem(new Cat()
            {
                Name = "Mom", Breed = "Kat2"
            });

            Console.WriteLine("List of all pets: dogs and cats:");
            pets.ProcessAllAnimals();
            Console.WriteLine();


            IList <Dog> dogsss = new List <Dog>()
            {
                new Dog()
                {
                    Name = "Rembo", Breed = "Kolli"
                },
                new Dog()
                {
                    Name = "Monet", Breed = "Kolli"
                },
            };

            pets.AddItem(dogsss[0]);

            Console.WriteLine("Introduce a dog:");
            dogsss[0].Introduce();
            Console.WriteLine();


            Console.WriteLine(" Update List of all pets: dogs and cats:");

            pets.ProcessAllAnimals();
            Console.WriteLine();

            Console.WriteLine("Introduce all dogs:");

            Animals <Dog> dogs = new Animals <Dog>();

            dogs.AddItem(new Dog()
            {
                Name = "RoboT"
            });
            dogs.AddItem(new Dog()
            {
                Name = "ToboT"
            });
            dogs.AddItem(new Dog()
            {
                Name = "HoboT"
            });

            dogs.ProcessAllAnimals();
            Console.WriteLine();
        }