예제 #1
0
 public Waiter(Bar bar, MainWindow mainWindow, Bartender bartender)
 {
     this.mainWindow     = mainWindow;
     this.bar            = bar;
     this.bartender      = bartender;
     this.SelectedOption = mainWindow.SelectedOption;
 }
예제 #2
0
파일: Bar.cs 프로젝트: Solum96/Lab6-TheBar
        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);
            }
        }