Beispiel #1
0
        public Bar(MainWindow mainWindow)
        {
            this.mainWindow = mainWindow;
            shelf           = new ConcurrentStack <BeerGlass>();
            table           = new ConcurrentStack <BeerGlass>();
            chair           = new ConcurrentStack <Chair>();
            guest           = new ConcurrentQueue <Patron>();
            glasses         = new ConcurrentStack <BeerGlass>();
            patronList      = new List <Patron>();
            var bouncer   = new Bouncer(this);
            var waitress  = new Waitress(this);
            var bartender = new Bartender(this);


            for (int i = 0; i < MaxNumOfGlasses; i++)
            {
                shelf.Push(new BeerGlass());
            }
            for (int i = 0; i < MaxNumOfChairs; i++)
            {
                chair.Push(new Chair());
            }

            BarInfo();
        }
 public SimulationManager(SimulationState stateToRun, double simulationSpeed)
 {
     timer         = new DispatcherTimer();
     establishment = GetEstablishment(stateToRun, simulationSpeed);
     window        = (MainWindow)App.Current.MainWindow;
     bouncer       = new Bouncer(establishment);
     bartender     = new Bartender(establishment);
     waitress      = new Waitress(establishment);
     logManager    = new LogManager(window, this);
 }
Beispiel #3
0
 public Bar(BarController barController)
 {
     BarController   = barController;
     currentBarState = BarState.Open;
     GenerateGlasses();
     GenerateChairs();
     Bartender = new Bartender(this);
     Bouncer   = new Bouncer(this);
     Waitress  = new Waitress(this);
 }
Beispiel #4
0
 void InitLogManager(MainWindow view, SimulationManager simulationManager)
 {
     startTime                         = DateTime.UtcNow;
     LogManager.view                   = view;
     bouncer                           = simulationManager.GetBouncer();
     waitress                          = simulationManager.GetWaitress();
     bartender                         = simulationManager.GetBartender();
     waitressLogMessages               = new List <string>();
     bartenderLogMessages              = new List <string>();
     patronLogMessages                 = new List <string>();
     view.WaitressListbox.ItemsSource  = waitressLogMessages;
     view.BartenderListbox.ItemsSource = bartenderLogMessages;
     view.PatronsListbox.ItemsSource   = patronLogMessages;
     SubscribeToEvents();
 }