예제 #1
0
 public void Add(string t)
 {
     if (Topping.toppingExist(t))
     {
         pizTopList.Add(t);
         toppingsMax++;
     }
     else
     {
         System.Console.WriteLine("that is not an available topping at your desired location");
     }
 }
예제 #2
0
        public int Thing()
        {
            if (choice == "r")
            {
                System.Console.WriteLine("Which topping would you like to remove?");
                string r = System.Console.ReadLine();
                if (pizTopExist(r))
                {
                    pizTopList.Remove(r);
                    cost = cost - .50m;
                    return(1);
                }

                System.Console.WriteLine("You do not currently have that topping.");
                return(1);
            }
            else if (choice == "a")
            {
                if (toppingsMax < 5)
                {
                    System.Console.WriteLine("Which topping would you like to add?\n");
                    Topping.displayToppings();
                    System.Console.WriteLine("\n\n");
                    string a = System.Console.ReadLine();
                    if (Topping.toppingExist(a))
                    {
                        Add(a);
                        cost = cost + .50m;
                        return(1);
                    }
                }
                else
                {
                    System.Console.WriteLine("I'm sorry you have hit the toppings limit. You must remove a topping to add one.");
                }
                return(1);
            }
            else if (choice != "f")
            {
                System.Console.WriteLine("That is not a valid option");
                return(1);
            }
            else
            {
                return(1);
            }
        }
예제 #3
0
파일: Pizza.cs 프로젝트: vitrv/Revature-P0
 public void AddTopping(Topping t)
 {
     _toppings.Add(t);
 }