Exemple #1
0
 private void PrepareIngredient(IIngredient ingredient)
 {
     Thread.Sleep(ingredient.PreparationTime);
     ingredient.IsPrepared = true;
     if (ingredient.NeedsCooking)
     {
         _kitchen.QueueIngredientToCook(ingredient);
         Console.ForegroundColor = ConsoleColor.White;
         Console.WriteLine($"[{_watch.Elapsed}] {_name}: {ingredient.ToString()} prepared for cooking");
     }
     else
     {
         Console.ForegroundColor = ConsoleColor.DarkBlue;
         Console.WriteLine($"[{_watch.Elapsed}] {_name}: {ingredient.ToString()} prepared");
     }
 }
 public bool PutIngredientIntoOwen(IIngredient ingredient)
 {
     if (_ingredients.Count == 0)
     {
         _ingredients.Add(ingredient);
         _currentIngredientType = ingredient.ToString();
         return(true);
     }
     else
     {
         if (ingredient.ToString() != _currentIngredientType || _ingredients.Count > Capacity)
         {
             return(false);
         }
         _ingredients.Add(ingredient);
         return(true);
     }
 }