Exemple #1
0
 public Patron(string name, int ID, UIUpdater uiUpdater)
     : base(uiUpdater)
 {
     this.name = name;
     patronID  = ID;
     LogStatus($"{name} enters the pub", this);
 }
Exemple #2
0
 public Pub(UIUpdater uiUpdater)
 {
     this.uiUpdater = uiUpdater;
     bouncer        = new Bouncer(uiUpdater, allPatrons, PatronProcess);
     bartender      = new Bartender(uiUpdater, glassesInShelf, queueToBar, allPatrons);
     waiter         = new Waiter(uiUpdater, glassesInShelf, glassesOnTables, allPatrons);
 }
Exemple #3
0
 public Bouncer(UIUpdater uiUpdater,
                ConcurrentDictionary <int, Patron> allPatrons,
                Action <Patron> createPatronTask)
     : base(uiUpdater)
 {
     this.allPatrons       = allPatrons;
     this.createPatronTask = createPatronTask;
 }
Exemple #4
0
 public Waiter(UIUpdater uiUpdater,
               ConcurrentQueue <Glass> glassesInShelf,
               ConcurrentBag <Glass> glassesOnTables,
               ConcurrentDictionary <int, Patron> allPatrons)
     : base(uiUpdater)
 {
     this.glassesInShelf  = glassesInShelf;
     this.glassesOnTables = glassesOnTables;
     this.allPatrons      = allPatrons;
 }
Exemple #5
0
 public Bartender(UIUpdater uiUpdater,
                  ConcurrentQueue <Glass> glassesInShelf,
                  ConcurrentQueue <Patron> queueToBar,
                  ConcurrentDictionary <int, Patron> allPatrons)
     : base(uiUpdater)
 {
     this.glassesInShelf = glassesInShelf;
     this.queueToBar     = queueToBar;
     this.allPatrons     = allPatrons;
 }
Exemple #6
0
 public SimulationManager()
 {
     uiUpdater     = new UIUpdater();
     pubSimulation = new Pub(uiUpdater);
 }
Exemple #7
0
 protected Agent(UIUpdater uiUpdater)
 {
     this.uiUpdater = uiUpdater;
 }