Пример #1
0
        private Cooker FindOptimal(Dish dish)
        {
            Cooker cook = new Cooker();

            foreach (Cooker cooker in this.cookers)
            {
                if (cooker.GetQuisines().Contains(dish.GetQuisine()))
                {
                    cook = cooker;
                    break;
                }
            }
            foreach (Cooker cooker_ in this.cookers)
            {
                if (cooker_.GetBusyFor() < cook.GetBusyFor() && cooker_.GetQuisines().Contains(dish.GetQuisine()))
                {
                    cook = cooker_;
                }
            }
            return(cook);
        }
Пример #2
0
 public void SetCooker(Cooker cook)
 {
     this.cooker   = cook;
     this.cookerId = cook.GetId();
 }
Пример #3
0
        public object Clone()
        {
            var newCooker = new Cooker(this.quisines.ToArray());

            return(newCooker);
        }
Пример #4
0
 public void AddCooker(Cooker cook)
 {
     this.cookers.Add(cook);
     cook.SetKitchen(this);
 }