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); }
public void Run() { Bartender.Run(this); Bouncer.Run(this); Waitress.Run(this); }