Exemplo n.º 1
0
 public Patron(string name, int ID, UIUpdater uiUpdater)
     : base(uiUpdater)
 {
     this.name = name;
     patronID  = ID;
     LogStatus($"{name} enters the pub", this);
 }
Exemplo n.º 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);
 }
Exemplo n.º 3
0
 public Bouncer(UIUpdater uiUpdater,
                ConcurrentDictionary <int, Patron> allPatrons,
                Action <Patron> createPatronTask)
     : base(uiUpdater)
 {
     this.allPatrons       = allPatrons;
     this.createPatronTask = createPatronTask;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 6
0
 public SimulationManager()
 {
     uiUpdater     = new UIUpdater();
     pubSimulation = new Pub(uiUpdater);
 }
Exemplo n.º 7
0
 protected Agent(UIUpdater uiUpdater)
 {
     this.uiUpdater = uiUpdater;
 }