Beispiel #1
0
 // Constructore
 public ArrayIterator(MenuItem[] items)
 {
     this._items = items;
 }
Beispiel #2
0
 public DinerMenuIterator(MenuItem[] items)
 {
     this._items = items;
 }
Beispiel #3
0
 public AlternatingDinerMenuIterator(MenuItem[] list)
 {
     this._list = list;
     _position = int.Parse(DateTime.Now.DayOfWeek.ToString()) % 2;
 }
Beispiel #4
0
 public void AddItem(String name, String description,
     bool vegetarian, double price)
 {
     MenuItem menuItem = new MenuItem(name, description, vegetarian, price);
     if (_numberOfItems >= MAX_ITEMS)
     {
         Console.WriteLine("Sorry, menu is full!  Can't add item to menu");
     }
     else
     {
         _menuItems[_numberOfItems] = menuItem;
         _numberOfItems = _numberOfItems + 1;
     }
 }