private void AddItem(string name, string description, bool vegetarian, double price)
 {
     MenuItem item = new MenuItem(name, description, vegetarian, price);
     if (numberOfItems >= MAX_ITEMS)
     {
         throw new Exception("Can't add new item to menu.");
     }
     else
     {
         menuItems[numberOfItems] = item;
         numberOfItems += 1;
     }
 }
 private void AddItem(string name, string description, bool vegetarian, double price)
 {
     MenuItem menuItem = new MenuItem(name, description, vegetarian, price);
     menuItems.Add(menuItem);
 }
Exemplo n.º 3
0
 public void AddItem(string name, string description, bool vegetarian, double price)
 {
     MenuItem item = new MenuItem(name, description, vegetarian, price);
     menuItems.Add(item.Name, item);
 }