public override void GoHome()
 {
     cts.Cancel();
     isWorking = false;
     LogHandler.UpdateLog("The bouncer went home.", LogHandler.MainWindow.GuestAndBouncerLog);
     ChangePubState(PubState.Closed);
 }
        private Patron LetPatronInside(Func <string> CheckID)
        {
            var patron = new Patron(Pub.GetGuestCount(), CheckID(), Pub, LogHandler, guestDrinkingModifer);

            LogHandler.UpdateLog($" {patron.Name} joined the party.", LogHandler.MainWindow.GuestAndBouncerLog);
            return(patron);
        }
Exemple #3
0
 public override void GoHome()
 {
     LogHandler.UpdateLog($" {Name} went home.",
                          LogHandler.MainWindow.GuestAndBouncerLog);
     Pub.RemoveGuest(this);
     Pub.TotalNumberOfGuests--;
     Pub.RemovePatronFromChair(this);
 }
 private void ReturnCleanGlasses()
 {
     Thread.Sleep(3000);
     LogHandler.UpdateLog(" returned glasses to bar", LogHandler.MainWindow.WaitressLog);
     foreach (var glass in tray)
     {
         Pub.Bar.AddAvailableGlass(GlassFromTray());
     }
 }
Exemple #5
0
 private Glass GetGlass()
 {
     while (Pub.Bar.HasAvailableGlasses() == false)
     {
         Thread.Sleep(10);
     }
     Thread.Sleep(fetchGlass / Pub.GlobalSpeedModifer);
     LogHandler.UpdateLog(" fetched a glass", LogHandler.MainWindow.BartenderLog);
     return(Pub.Bar.GetOneCleanGlass());
 }
Exemple #6
0
 private void DrinkBeer()
 {
     LogHandler.UpdateLog($" {Name} sat down, and is drinking their beer",
                          LogHandler.MainWindow.GuestAndBouncerLog);
     Thread.Sleep(drinkingTime / Pub.GlobalSpeedModifer);
     LogHandler.UpdateLog($" {Name} finished their beer.",
                          LogHandler.MainWindow.GuestAndBouncerLog);
     Pub.Bar.AddUsedGlass(Beer);
     Beer = null;
     GoHome();
 }
Exemple #7
0
 private void WaitForGuest()
 {
     if (Pub.CheckForLine() == false)
     {
         LogHandler.UpdateLog(" waiting for guest", LogHandler.MainWindow.BartenderLog);
     }
     while (Pub.CheckForLine() == false)
     {
         Thread.Sleep(10);
     }
 }
Exemple #8
0
 private void WaitForEmptyChair()
 {
     LogHandler.UpdateLog($" {Name} is looking for a chair", LogHandler.MainWindow.GuestAndBouncerLog);
     while (IsLookingForChair())
     {
         Chair chair;
         if (Pub.TryGetChair(out chair))
         {
             chair.Occupant = this;
             IsSittingDown  = true;
             break;
         }
         Thread.Sleep(10);
     }
 }
 private void FetchGlasses()
 {
     while (TrayIsEmpty())
     {
         if (Pub.Bar.HasUsedGlasses())
         {
             LogHandler.UpdateLog(" fetching dirty glasses", LogHandler.MainWindow.WaitressLog);
             Thread.Sleep(fetchingTime / speedModifier / Pub.GlobalSpeedModifer);
             for (int i = 0; i < Pub.Bar.NumberOfUsedGlasses; i++)
             {
                 tray.Add(Pub.Bar.GetOneUsedGlass());
             }
         }
         Thread.Sleep(10);
     }
 }
Exemple #10
0
 private void GoToBar()
 {
     Thread.Sleep(timeToWalkToBar / Pub.GlobalSpeedModifer);
     LogHandler.UpdateLog($" {Name} went to the bar.", LogHandler.MainWindow.GuestAndBouncerLog);
     Pub.GetInBarQueue(this);
 }
 public override void GoHome()
 {
     cts.Cancel();
     LogHandler.UpdateLog(" drank a beer and went home.", LogHandler.MainWindow.WaitressLog);
 }
 private void WashDishes()
 {
     LogHandler.UpdateLog(" washing dishes", LogHandler.MainWindow.WaitressLog);
     Thread.Sleep(washingTime / speedModifier / Pub.GlobalSpeedModifer);
 }
Exemple #13
0
 public override void GoHome()
 {
     cts.Cancel();
     LogHandler.UpdateLog(" closed bar and went home.", LogHandler.MainWindow.BartenderLog);
 }
Exemple #14
0
 private void PourBeer(Glass beerToServe, Patron patron)
 {
     Thread.Sleep(pourBeer / Pub.GlobalSpeedModifer);
     LogHandler.UpdateLog($" poured {patron.Name} a beer.", LogHandler.MainWindow.BartenderLog);
     beerToServe.HasBeer = true;
 }