Exemple #1
0
        public void OrderPizza(PizzaType type)
        {
            Pizza pizza = pizzaFactory.CreatePizza(type);

            pizza.Prepare();
            pizza.Bake();
            pizza.Cut();
            pizza.Box();
        }
Exemple #2
0
        public IPizza OrderPizza(IList <string> ingredients)
        {
            IPizza pizza = _factory.CreatePizza(ingredients);

            pizza.Bake();
            pizza.Cut();
            pizza.Box();
            return(pizza);
        }
Exemple #3
0
        public string GetDetailsHtml(PizzaState wizardState)
        {
            var pizza = pizzaFactory.CreatePizza(wizardState);

            return
                (string.Format(
                     "<div>Selected pizza: {0}</div><div>Price: <span style=\"font-weight: bold; font-size: larger;\">{1}</span></div>",
                     pizza.PizzaDescription,
                     priceCalculator.CalculatePrice(pizza).ToString("c")));
        }
        public IPizza OrderPizza(PizzaType pizzaType)
        {
            IPizza pizza = _pizzaFactory.CreatePizza(pizzaType);

            pizza.Prepare();
            pizza.Bake();
            pizza.Cut();
            pizza.Box();

            return(pizza);
        }
Exemple #5
0
        public static void MakePizza(IPizzaFactory pizzaFactory, bool stuffedCrust)
        {
            var pizza = pizzaFactory.CreatePizza();

            pizza.MakePizza(stuffedCrust);
            Console.WriteLine($"{pizza.PizzaName} : £{pizza.Price} {(pizza.StuffedCrust ? "with stuffed crust" : "with regular crust")}");
            Console.WriteLine($"with {pizza.Sauce} sauce");
            Console.WriteLine("Toppings");
            foreach (var topping in pizza.Toppings)
            {
                Console.WriteLine(topping);
            }

            Console.WriteLine($"Ready in {pizza.TimeToPrepare.TotalMinutes} minutes.");
            Console.WriteLine();
        }
Exemple #6
0
 protected Pizza CreatePizza(PizzaStyle pizzaStyle)
 {
     return(_pizzaFactory.CreatePizza(pizzaStyle));
 }
 public Pizza CreatePizza() => _pizzaFactory.CreatePizza();
Exemple #8
0
 public Pizza OrderPizza(string pizzaType)
 {
     return(pizzaFactory.CreatePizza(pizzaType));
 }