public Waiter(Bar bar, MainWindow mainWindow, Bartender bartender) { this.mainWindow = mainWindow; this.bar = bar; this.bartender = bartender; this.SelectedOption = mainWindow.SelectedOption; }
public void OpenBar() { this.IsOpen = true; this.openingTimer = new BarTimer(this, mainWindow); this.bouncer = new Bouncer(this, mainWindow); this.bartender = new Bartender(this, mainWindow); this.waiter = new Waiter(this, mainWindow, bartender); SelectedOption = mainWindow.SelectedOption; if (SelectedOption == MainWindow.Presets.LotsOfGlass) { numberOfGlass = 20; numberOfChairs = 3; } if (SelectedOption == MainWindow.Presets.LotsOfTables) { numberOfChairs = 20; numberOfGlass = 5; } for (int i = 0; i < numberOfGlass; i++) { glasses.Push(new Glass()); } for (int i = 0; i < numberOfChairs; i++) { chairs.Enqueue(new Chair()); } bartender.Work(); bouncer.Work(); waiter.Work(); if (SelectedOption == MainWindow.Presets.AllNightBar) { openingTimer.RunTimer(300); } else { openingTimer.RunTimer(120); } }