Esempio n. 1
0
        static void Main(string[] args)
        {
            DogStore.Insert(new Dog()
            {
                Name = "Rex", Age = 5, Type = "german sheperd", GoodBoi = true, FavoriteFood = "Meat"
            });
            DogStore.Insert(new Dog()
            {
                Name = "Bak", Age = 2, Type = "husky", GoodBoi = false, FavoriteFood = "Vegetables"
            });
            DogStore.PrintPets();

            DogStore.BuyPet("Bak");
            CatStore.BuyPet("Test");
            DogStore.PrintPets();

            CatStore.Insert(new Cat()
            {
                Name = "Garefield", Age = 2, Type = "domestic", Lazy = true, LivesLeft = 6
            });
            CatStore.Insert(new Cat()
            {
                Name = "Tom", Age = 12, Type = "wild", Lazy = false, LivesLeft = 1
            });
            CatStore.PrintPets();

            CatStore.BuyPet("Tom");
            CatStore.BuyPet("Simba");
            CatStore.PrintPets();

            FishStore.Insert(new Fish()
            {
                Name = "Nemo", Age = 2, Type = "clown fish", Color = "Orange", Size = "xs"
            });
            FishStore.Insert(new Fish()
            {
                Name = "Sharky", Age = 12, Type = "shark", Color = "White", Size = "xxl"
            });
            FishStore.PrintPets();

            FishStore.BuyPet("Nemo");
            FishStore.BuyPet("Sharky");
            FishStore.PrintPets();

            Console.ReadLine();
        }
Esempio n. 2
0
 static void Main(string[] args)
 {
     #region DogStore
     var dog1 = new Dog("Riki", Type.Dog, 1, true, "meat");
     dog1.PrintInfo();
     var dog2 = new Dog("Marko", Type.Dog, 2, false, "bone");
     dog2.PrintInfo();
     var dogStore = new PetStore <Dog>();
     dogStore.Pets.Add(dog1);
     dogStore.Pets.Add(dog2);
     dogStore.PrintPets();
     dogStore.BuyPet(dog1);
     dogStore.PrintPets();
     #endregion
     #region CatStore
     var cat1 = new Cat("Mia", Type.Cat, 4, true, 5);
     var cat2 = new Cat("Tomas", Type.Cat, 2, false, 8);
     cat1.PrintInfo();
     var catStore = new PetStore <Cat>();
     catStore.Pets.Add(cat1);
     catStore.Pets.Add(cat2);
     catStore.PrintPets();
     catStore.BuyPet(cat1);
     catStore.PrintPets();
     #endregion
     #region FishStore
     var fish1 = new Fish("Nemo", Type.Fish, 1, "yellow", 1.3);
     var fish2 = new Fish("Jack", Type.Fish, 1, "blue", 1.5);
     fish2.PrintInfo();
     var fishStore = new PetStore <Fish>();
     fishStore.Pets.Add(fish1);
     fishStore.Pets.Add(fish2);
     fishStore.BuyPet(fish1);
     fishStore.PrintPets();
     #endregion
     Console.ReadKey();
 }