Example #1
0
 public IPizza createPepperInstansce(IPizza pizza, decimal cout)
 {
     for (int i = 0; i < cout; i++)
     {
         pizza = new PepperDecorator(pizza);
     }
     return(pizza);
 }
Example #2
0
        static void Main(string[] args)
        {
            ChickenPizza chickenPizza = new ChickenPizza();
            TomatoPizza  tomatoPizza  = new TomatoPizza();

            CheeseDecorator cheeseDecorator = new CheeseDecorator(chickenPizza);

            Console.WriteLine(cheeseDecorator.DoPizza());

            PepperDecorator pepperDecorator = new PepperDecorator(cheeseDecorator);

            Console.WriteLine(pepperDecorator.DoPizza());

            Console.ReadKey();
        }