Esempio n. 1
0
        private static void Main(string[] args)
        {
            var _calValor = new CalculaValor();

            IPizzaBuilder pizzaQuenteBuilder   = new PizzaQuente(_calValor);
            IPizzaBuilder pizzaModaCasaBuilder = new PizzaModaCasa(_calValor);

            var cardapioService = new CardapioServices();

            #region Pizza 1 - Pizza Quente com Borda

            cardapioService.PrepararPizzaComBorda(pizzaQuenteBuilder, PizzaSize.Grande,
                                                  new Borda
            {
                BordaType = BordaType.Cheddar,
                BordaSize = BordaSize.Grossa
            });

            var pizzaQuenteComBorda = pizzaQuenteBuilder.GetPizza();

            #endregion

            #region Pizza 2 - Pizza Quente sem Borda

            cardapioService.PrepararPizzaSemBorda(pizzaQuenteBuilder, PizzaSize.Normal);

            var pizzaQuenteSemBorda = pizzaQuenteBuilder.GetPizza();

            #endregion

            #region Pizza 3 - Pizza Moda da Casa com Borda

            cardapioService.PrepararPizzaComBorda(pizzaModaCasaBuilder, PizzaSize.Familia,
                                                  new Borda
            {
                BordaType = BordaType.Catupiry,
                BordaSize = BordaSize.Fina
            });
            var pizzaModaCasaComBorda = pizzaModaCasaBuilder.GetPizza();

            #endregion

            View("Primeiro pedido", pizzaQuenteComBorda);
            View("Segundo pedido", pizzaQuenteSemBorda);
            View("Terceiro pedido", pizzaModaCasaComBorda);
        }
        private static void Main(string[] args)
        {
            var calcValor = new CalculaValor();

            IPizzaBuilder pizzaCalabresaBuilder = new PizzaCalabresa(calcValor);
            IPizzaBuilder pizzaModaCasaBuilder  = new PizzaModaCasa(calcValor);

            var cardapioService = new CardapioServices();

            #region Pizza 1

            cardapioService.PrepararPizzaComBorda(pizzaCalabresaBuilder, PizzaSize.Grande,
                                                  new Borda
            {
                BordaType = BordaType.Catupiry, BordaSize = BordaSize.Normal
            });

            var pizzacalabresa1 = pizzaCalabresaBuilder.GetPizza();

            #endregion Pizza 1

            #region Pizza 2

            cardapioService.PrepararPizzaSemBorda(pizzaCalabresaBuilder, PizzaSize.Grande);

            var pizzacalabresa2 = pizzaCalabresaBuilder.GetPizza();

            #endregion Pizza 2

            #region Pizza 3

            cardapioService.PrepararPizzaComBorda(pizzaModaCasaBuilder, PizzaSize.Grande,
                                                  new Borda
            {
                BordaType = BordaType.Chedder, BordaSize = BordaSize.Normal
            });

            var pizzaModaCasa1 = pizzaModaCasaBuilder.GetPizza();

            #endregion Pizza 3

            View("Pizza 1: ", pizzacalabresa1);
            View("Pizza 2: ", pizzacalabresa2);
            View("Pizza 3: ", pizzaModaCasa1);
        }