Beispiel #1
0
 public override void AddTopping(Topping t)
 {
     if (Toppings.Count > MaxToppings + 1)
     {
         Console.WriteLine("Max Amount of Toppings reached ({0}). ", MaxToppings);
         return;
     }
     else
     {
         Toppings.Add(t);
     }
     CalculatePrice();
 }
Beispiel #2
0
 public void AddToppings(AStore store)
 {
     foreach (string s in _presetToppings)
     {
         foreach (Topping t in store.ToppingsList)
         {
             if (t.Name == s)
             {
                 Toppings.Add(t);
                 break;
             }
         }
     }
 }
Beispiel #3
0
        protected override void AddToppings()
        {
            int MaxToppings = 3;

            CYOPizza.DisplayXMLMenu(AllToppings);
            Console.WriteLine("What Toppings would you like on your pizza? Pick up to three, and choose 0 to skip!\nThe first two toppings come included in your pizza!");
            Toppings.Add(AllToppings[0]);
            Toppings.Add(AllToppings[1]);
            while (MaxToppings > 0)
            {
                Toppings Temp = Common.SwitchChoice(0, 10, AllToppings);
                if (Temp is null)
                {
                }
                else
                {
                    Toppings.Add(Temp);
                }
                MaxToppings--;
            }
        }
 public void AddTopping(Topping t)
 {
     Toppings.Add(t);
 }
Beispiel #5
0
 public override void AddToppings()
 {
     Toppings.Add(new Topping());
 }
Beispiel #6
0
        // public override void AddCrust()
        // {
        //     Crust = null;
        // }



        public override void AddToppings(Toppings topping)
        {
            Toppings.Add(topping);
        }
 public override void AddToppings()
 {
     Toppings.Add(new VeggieTopping());
     Toppings.Add(new VeggieTopping());
 }
Beispiel #8
0
        public static Toppings GetTopping(string topping)
        {
            Toppings top = new Toppings(topping);

            return(top);
        }
 protected override void AddToppings()
 {
     Toppings.Add(new Brocolli());
     Toppings.Add(new Onion());
     Toppings.Add(new Cheese());
 }
 protected override void AddToppings()
 {
     Toppings.Add(new Pepperoni());
     Toppings.Add(new Cheese());
 }
Beispiel #11
0
 public override void AddToppings()
 {
     Toppings.AddRange(new Topping[] { new PepperoniTopping(), new BaconTopping() });
 }
Beispiel #12
0
 public override void RemoveTopping(Topping topping)
 {
     Toppings.Remove(topping);
 }
Beispiel #13
0
 public decimal CalculatePrice()
 {
     return(Crust.Price + Size.Price + Toppings.Sum(t => t.Price));
 }
Beispiel #14
0
 public override void AddToppings()
 {
     Toppings.AddRange(new Topping[] { new Topping(), new Topping() });
 }
 public override void AddToppings()
 {
     Toppings.AddRange(new Topping[] { new MushroomTopping(), new OnionTopping() });
 }
Beispiel #16
0
 public void AddTopping(int n)
 {
     Toppings.Add(new Topping(n));
 }
Beispiel #17
0
        // protected override void AddCrust(string crustType, double cost)
        // {
        //     crust = new Crust(crustType, cost);
        // }
        // protected override void AddSize(string size, double cost)
        // {
        //     this.size = new Size(size, cost);
        // }
        protected void AddToppings()
        {
            bool   done = false;
            string input;

            do
            {
                Console.WriteLine("Would you like to add a topping? \n($.50 per topping, duplicates will count as additional servings)\n 1. Yes\n 2. No");
                input = Console.ReadLine();
                switch (input)
                {
                case "1":

                    Console.WriteLine("What topping would you like to add?\n 1. Pepperonni" +
                                      "\n 2. Sausage\n 3. Bacon\n 4. Ham\n 5. Onions" +
                                      "\n 6. Olives\n 7. Banana Peppers\n 8. Tomatoes" +
                                      "\n 9. Spinach");
                    input = Console.ReadLine();
                    switch (input)
                    {
                    case "1":
                        Topping pepperonni = new Topping("Pepperonni", 0.50);
                        Toppings.Add(pepperonni);
                        break;

                    case "2":
                        Topping sausage = new Topping("Sausage", 0.50);
                        Toppings.Add(sausage);
                        break;

                    case "3":
                        Topping bacon = new Topping("Bacon", 0.50);
                        Toppings.Add(bacon);
                        break;

                    case "4":
                        Topping ham = new Topping("Ham", 0.50);
                        Toppings.Add(ham);
                        break;

                    case "5":
                        Topping onions = new Topping("Onions", 0.50);
                        Toppings.Add(onions);
                        break;

                    case "6":
                        Topping olives = new Topping("Olives", 0.50);
                        Toppings.Add(olives);
                        break;

                    case "7":
                        Topping bananaPeppers = new Topping("Banana Peppers", 0.50);
                        Toppings.Add(bananaPeppers);
                        break;

                    case "8":
                        Topping tomatoes = new Topping("Tomatoes", 0.50);
                        Toppings.Add(tomatoes);
                        break;

                    case "9":
                        Topping spinach = new Topping("Spinach", 0.50);
                        Toppings.Add(spinach);
                        break;

                    default:
                        InvalidInput();
                        break;
                    }

                    break;

                case "2":
                    Console.WriteLine("O.K.");
                    done = true;
                    break;

                default:
                    InvalidInput();
                    break;
                }
            }while(!done);
        }