示例#1
0
 public YeOldePub(DataManager dataManager)
 {
     DataManager            = dataManager;
     currentPubState        = PubState.Open;
     PatronsWaitingForBeer  = new ConcurrentQueue <Patron>();
     PatronsWaitingForChair = new ConcurrentQueue <Patron>();
     Patrons = new ConcurrentDictionary <String, Patron>();
     Tables  = new BlockingCollection <PintGlass>();
     Shelves = new BlockingCollection <PintGlass>();
     for (int i = 0; i < NumOfPintGLasses; i++)
     {
         Shelves.Add(new PintGlass());
     }
     Chairs = new BlockingCollection <Chair>();
     for (int i = 0; i < NumOfChairs; i++)
     {
         Chairs.Add(new Chair());
     }
     Bartender = new Bartender(this);
     Bouncer   = new Bouncer(this);
     Waitress  = new Waitress(this);
 }
示例#2
0
 public void Run()
 {
     Bartender.Run(this);
     Bouncer.Run(this);
     Waitress.Run(this);
 }