//Check methods in the workstaion classes, makes sure that there are ingredients ready public static void CheckSausage() { if (SausageBuffer.Count == 0) { for (int i = 0; i < grillLimit; i++) { lock (SausageBuffer) { SausageBuffer.Enqueue((Sausage)IngredientFactory.CreateSausage()); } } Console.WriteLine("Putting sausage on grill {0}", SausageBuffer.Count + " " + "Sausages was placed on grill "); Thread.Sleep(3000); } }
//Check methods in the workstaion classes: makes sure that there are ingredients ready public static void Check() { if (BoilerBuffer.Count == 0) { for (int i = 0; i < boilerLimit; i++) { lock (BoilerBuffer) { BoilerBuffer.Enqueue((Sausage)IngredientFactory.CreateSausage()); } } Console.WriteLine("Putting sausage in boiler {0}", BoilerBuffer.Count + " " + "Sausages was placed in boiler "); //Thread.Sleep(); } }