Ejemplo n.º 1
0
 //Check methods in the workstaion classes: makes sure that there are ingredients ready
 public static void CheckBeef()
 {
     if (BeefBuffer.Count == 0)
     {
         for (int i = 0; i < beefLimit; i++)
         {
             lock (BeefBuffer)
             {
                 BeefBuffer.Enqueue((Beef)IngredientFactory.CreateBeef());
             }
         }
         Console.WriteLine("Putting beef on grill {0}", BeefBuffer.Count + " " + "beef was placed on grill ");
         Thread.Sleep(3000);
     }
 }
Ejemplo n.º 2
0
 //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();
     }
 }
Ejemplo n.º 3
0
 //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);
     }
 }
Ejemplo n.º 4
0
 //Check methods in the workstaion classes: makes sure that there are ingredients ready
 public static void Check()
 {
     if (FryBuffer.Count == 0)
     {
         for (int i = 0; i < fryLimit; i++)
         {
             lock (FryBuffer)
             {
                 FryBuffer.Enqueue((Fry)IngredientFactory.CreateFries());
             }
         }
         Console.WriteLine("Putting fries in fryer {0}", FryBuffer.Count + " " + "fries was put in fryer ");
         Thread.Sleep(3000);
     }
 }