public void AddPizza(List <AIngredient> pizzaToAdd) { if (Pizzas.Count < 100) { Pizzas.Add(pizzaToAdd); } }
public bool AddPizza(APizza pizza) { if (!(IsBelowMaxPrice(pizza.CalculateTotalPrice()) && IsBelowMaxPizzas(1) && IsPizzaToppingsOk(pizza))) { return(false); } Pizzas.Add(pizza); TotalPrice += pizza.CalculateTotalPrice(); date = DateTime.Now; return(true); }
public void CreatePizza(Store store) { Pizza pizza = store.ChoosePizza(); pizza.Size = store.ChooseSize(); pizza.Crust = store.ChooseCrust(); if ((this.CalculatePrice() + pizza.GetPrice()) > 250) { System.Console.WriteLine("Pizza cannot be added as the order will exceed the $250 limit!"); System.Console.WriteLine(); return; } Pizzas.Add(pizza); }
public void CreatePizza(string size, string crust, List <string> toppings) { if (Pizzas.Count < 50) { Pizzas.Add(new Pizza(size, crust, toppings)); //Re-calculate order price Price = CalcOrderPrice(); } else { System.Console.WriteLine("Too many pizzas in order; could not add pizza. Please remove some pizzas or make a separate order."); } }
protected void addPizzaToOrder(APizza pizza) { pizza.Price = pizza.Crust.Price + pizza.Size.Price; foreach (Topping t in pizza.Toppings) { pizza.Price += t.Price; } if (Pizzas == null) { Pizzas = new List <APizza>(); } Pizzas.Add(pizza); _ordered = true; Console.WriteLine("Your pizza has been added to your order."); Console.WriteLine(); doNext(); }
public void CreatePizza() { Pizzas.Add(new Pizza()); }
public void AddPizza(int choice) { if (choice == 1) { // check to see if amount of pizza is less than 50 if (Pizzas.Count < 25) { APizzaModel p = _pizzaFactory.Make <PepperoniPizza>(); p.OrderId = EntityId; Pizzas.Add(p); Total = Total + 10; } else { Console.WriteLine("Max Order amount reached"); } } else if (choice == 2) { if (Pizzas.Count < 25) { APizzaModel p = _pizzaFactory.Make <FourCheesePizza>(); p.OrderId = EntityId; Pizzas.Add(p); Total = Total + 10; } else { Console.WriteLine("Max Order amount reached"); } } else if (choice == 3) { if (Pizzas.Count < 25) { APizzaModel p = _pizzaFactory.Make <VeggiePizza>(); p.OrderId = EntityId; Pizzas.Add(p); Total = Total + 10; } else { Console.WriteLine("Max Order amount reached"); } } else if (choice == 4) { if (Pizzas.Count < 25) { APizzaModel p = _pizzaFactory.Make <MeatPizza>(); p.OrderId = EntityId; Pizzas.Add(p); Total = Total + 10; } else { Console.WriteLine("Max Order amount reached"); } } else if (choice == 5) { if (Pizzas.Count < 25) { APizzaModel p = _pizzaFactory.Make <MeatPizza>(); p.OrderId = EntityId; p.Size = "Large"; Pizzas.Add(p); Total = Total + 10; } else { Console.WriteLine("Max Order amount reached"); } } else if (choice == 6) { if (Pizzas.Count < 25) { APizzaModel p = _pizzaFactory.Make <PepperoniPizza>(); p.OrderId = EntityId; Pizzas.Add(p); Total = Total + 10; } else { Console.WriteLine("Max Order amount reached"); } } else if (choice == 7) { if (Pizzas.Count < 25) { APizzaModel p = _pizzaFactory.Make <FourCheesePizza>(); p.OrderId = EntityId; Pizzas.Add(p); Total = Total + 10; } else { Console.WriteLine("Max Order amount reached"); } } else if (choice == 8) { if (Pizzas.Count < 25) { APizzaModel p = _pizzaFactory.Make <VeggiePizza>(); p.OrderId = EntityId; Pizzas.Add(p); Total = Total + 10; } else { Console.WriteLine("Max Order amount reached"); } } else if (choice == 0) { System.Console.WriteLine("Finished Ordering.."); } else { System.Console.WriteLine("Choose a valid option"); } }
public void AddPizza(APizza pizza) { Pizzas.Add(pizza); Total += pizza.Crust.Price + pizza.Size.Price + pizza.Toppings.Sum(t => t.Price); }
public void MakeCustomPizza(Crust Crust, Size Size, List <Topping> Toppings) { Pizzas.Add(new CustomPizza(Crust, Size, Toppings)); }
public void MakeCheesePizza() { Pizzas.Add(_pizzaFactory.Make <CheesePizza>()); }
public void MakeMeatPizza() { Pizzas.Add(_pizzaFactory.Make <MeatPizza>()); }
public bool AddPizza(APizza pizza) { Pizzas.Add(pizza); return(true); }