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); }
public void SetCooker(Cooker cook) { this.cooker = cook; this.cookerId = cook.GetId(); }
public object Clone() { var newCooker = new Cooker(this.quisines.ToArray()); return(newCooker); }
public void AddCooker(Cooker cook) { this.cookers.Add(cook); cook.SetKitchen(this); }