Exemplo n.º 1
0
        public void Run()
        {
            try
            {
                string[] pizzaElements = Console.ReadLine()
                                         .Split(" ")
                                         .ToArray();

                string[] doughElements = Console.ReadLine()
                                         .Split(" ")
                                         .ToArray();

                Dough dough = DoughFactory.Create(doughElements);

                Pizza pizza = PizzaFactory.Create(pizzaElements, dough);

                string input = string.Empty;

                while ((input = Console.ReadLine()) != "END")
                {
                    string[] toppingElements = input
                                               .Split(" ")
                                               .ToArray();

                    Topping topping = ToppingFactory.Create(toppingElements);

                    pizza.AddTopping(topping);
                }

                Console.WriteLine(pizza);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Exemplo n.º 2
0
 public void Assemble(DoughFactory abstractDoughFactory)
 {
     dough = abstractDoughFactory.GetPizzaDough();
 }
Exemplo n.º 3
0
 public void Assemble(DoughFactory abstractDoughFactory)
 {
     DecoretedPizza.Assemble(abstractDoughFactory);
 }