Exemplo n.º 1
0
        public void Demonstrate()
        {
            Pizza largeP = new LargePizza();
            largeP = new Cheese(largeP);
            largeP = new Papper(largeP);
            largeP = new Ham(largeP);

            var MidP = new MediumPizza();

            Console.WriteLine($" you have buyed {largeP.GetDescription()} with Price:{largeP.CalculateCost()}");
            Console.WriteLine($" you have buyed {MidP.Description} with Price:{MidP.CalculateCost()}");
        }
Exemplo n.º 2
0
        public void Demonstrate()
        {
            Pizza largeP = new LargePizza();

            largeP = new Cheese(largeP);
            largeP = new Papper(largeP);
            largeP = new Ham(largeP);

            var MidP = new MediumPizza();

            Console.WriteLine($" you have buyed {largeP.GetDescription()} with Price:{largeP.CalculateCost()}");
            Console.WriteLine($" you have buyed {MidP.Description} with Price:{MidP.CalculateCost()}");
        }