示例#1
0
        private void AddCourse(OccupiedTable t)
        {
            Course c = t.AddCourse();
            Order o;
            List<Dish> orderedDishes = new List<Dish>();
            int i = 0;
            foreach(Category cat in Restaurant.Categories)
                foreach(Dish d in cat.Dishes)
                {
                    if (i % 2 == 0)
                        orderedDishes.Add(d);
                    i++;
                }

            for(int j = 0; j < 4; j++)
            {
                o = new Order(orderedDishes[j], j + 1);
                c.Orders.Add(o);
            }
        }
示例#2
0
 public void FreeTable()
 {
     this.Occupants = null;
     this.Occupied  = false;
 }
示例#3
0
 public void OccupyTable(OccupiedTable o)
 {
     this.Occupants = o;
     this.Occupied  = true;
 }