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); }
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()); } }
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()); }
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(); }
private void WaitForGuest() { if (Pub.CheckForLine() == false) { LogHandler.UpdateLog(" waiting for guest", LogHandler.MainWindow.BartenderLog); } while (Pub.CheckForLine() == false) { Thread.Sleep(10); } }
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); } }
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); }
public override void GoHome() { cts.Cancel(); LogHandler.UpdateLog(" closed bar and went home.", LogHandler.MainWindow.BartenderLog); }
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; }