예제 #1
0
        private static void Main(string[] args)
        {
            IHamburguer hamburguer       = new Hamburguer();
            IHamburguer cheddarDecorator = new CheddarDecorator(hamburguer);
            IHamburguer baconDecorator   = new BaconDecorator(cheddarDecorator);
            IHamburguer ovosDecorator    = new OvosDecorator(baconDecorator);

            Console.WriteLine(ovosDecorator.BuscarTipoHamburguer());
            Console.WriteLine();
        }
예제 #2
0
        private static void Main(string[] args)
        {
            IPizza pizza           = new Pizza();
            IPizza queijoDecorator = new QueijoDecorator(pizza);
            IPizza baconDecorator  = new BaconDecorator(queijoDecorator);
            IPizza cebolaDecorator = new CebolaDecorator(baconDecorator);

            Console.WriteLine(cebolaDecorator.BuscarTipoPizza());
            Console.WriteLine();
        }