示例#1
0
 public void TakeRoastedSausage()
 {
     try
     {
         lock (stoveLock)
         {
             if (RoastedSausageQueue.Count != 0)
             {
                 RoastedSausageQueue.Dequeue();
             }
         }
     }
     catch (Exception msg)
     {
         Debug.WriteLine($" #################################### Could not take roasted sausage: {msg.Message}");
     }
 }
示例#2
0
 public void PrepareRoastedSausage()
 {
     // Prepare some sort of sausage, these will be roasted.
     // Roast them on the stove, 12 minutes, for a max of 28 at a time.
     // Can be held warm for 6 hours.
     try
     {
         lock (stoveLock)
         {
             if (RoastedSausageQueue.Count == 0)
             {
                 for (int i = 0; i < roastedSausage.Limit; i++)
                 {
                     RoastedSausageQueue.Enqueue(roastedSausage);
                 }
                 Thread.Sleep(roastedSausage.PrepTime);
             }
         }
     }
     catch (Exception msg)
     {
         Debug.WriteLine($" #################################### Could not roast sausage batch: {msg.Message}");
     }
 }