protected override void InitPresetPizza()
        {
            /*Meat*/
            CustomPizza tempP = new CustomPizza();

            tempP.Type = "Meat Pizza";
            tempP.AddCrust(CrustList[0]);
            tempP.AddTopping(ToppingsList[0]);
            tempP.AddTopping(ToppingsList[1]);
            tempP.AddTopping(ToppingsList[2]);
            tempP.AddTopping(ToppingsList[6]);
            tempP.AddTopping(ToppingsList[8]);
            tempP.CalculatePrice();
            PresetPizza.Add(tempP);
            /*Hawaiian*/
            tempP      = new CustomPizza();
            tempP.Type = "Hawaiian Pizza";
            tempP.AddCrust(CrustList[0]);
            tempP.AddTopping(ToppingsList[2]);
            tempP.AddTopping(ToppingsList[5]);
            tempP.AddTopping(ToppingsList[7]);
            tempP.CalculatePrice();
            PresetPizza.Add(tempP);
            /*Deluxe*/
            tempP      = new CustomPizza();
            tempP.Type = "Deluxe Pizza";
            tempP.AddCrust(CrustList[0]);
            tempP.AddTopping(ToppingsList[6]);
            tempP.AddTopping(ToppingsList[9]);
            tempP.AddTopping(ToppingsList[3]);
            tempP.AddTopping(ToppingsList[5]);
            tempP.AddTopping(ToppingsList[11]);
            tempP.CalculatePrice();
            PresetPizza.Add(tempP);
        }
예제 #2
0
        public override ATruePizza Make()
        {
            ATruePizza FinalPizza = new CustomPizza();

            SelectCrust(ref FinalPizza);
            SelectSize(ref FinalPizza);
            SelectToppings(ref FinalPizza);
            return(FinalPizza);
        }
예제 #3
0
파일: Order.cs 프로젝트: smithc92/PizzaBox
        public double OrderCost()
        {
            double OrderCost = 0;

            foreach (var CustomPizza in PizzaOrder)
            {
                OrderCost += CustomPizza.Price();
            }
            return(OrderCost);
        }
예제 #4
0
파일: Order.cs 프로젝트: smithc92/PizzaBox
        public string PrintOrder()
        {
            string order = "This order contains: ";

            foreach (var CustomPizza in PizzaOrder)
            {
                order += CustomPizza.ToString() + " ";
            }
            order += "Grand Total: $" + OrderCost();
            return(order);
        }
        protected override void InitPresetPizza()
        {
            /*Veggie*/
            CustomPizza tempP = new CustomPizza();

            tempP.Type = "Basic Veggie Pizza";
            tempP.AddCrust(CrustList[0]);
            tempP.AddTopping(ToppingsList[0]);
            tempP.AddTopping(ToppingsList[1]);
            tempP.AddTopping(ToppingsList[4]);
            tempP.AddTopping(ToppingsList[6]);
            tempP.CalculatePrice();
            PresetPizza.Add(tempP);
        }
예제 #6
0
        protected void customPizza()
        {
            CustomPizza toAdd = new CustomPizza();

            toAdd.Size     = chooseSize();
            toAdd.Crust    = chooseCrust();
            toAdd.Toppings = chooseToppings();
            if (toAdd.getSuccess())
            {
                addPizzaToOrder(toAdd);
            }
            else
            {
                Console.WriteLine("Pizza cannot be added to order.");
                doNext();
            }
        }
예제 #7
0
        public void AddToOrder(Order o, CustomPizza p)
        {
            p.CalculatePrice();
            _db.Pizza.Add(new Data.Entities.Pizza
            {
                Crust = new PizzaBox.Data.Entities.Crust
                {
                    Name = p.Crust.Name
                },
                Size = new PizzaBox.Data.Entities.Size
                {
                    Name = p.Size.Name
                },
                Price = p.Price
            });

            _db.SaveChanges();

            o.Pizzas.Add(p);
        }
예제 #8
0
 public void StartCustomPizza()
 {
     CurrentPizza = new CustomPizza();
 }