public override void AddServicePoint(ServicePoint s) { this.service_points.Add(s); s.getQueue().SetParent(this); if (s.getMaxItems() > this.maxItems) { this.maxItems = s.getMaxItems(); } }
public void MoveClientsToCash(ServicePoint sp) { /* if (c.currentQueue.GetSize() > 0) { while (sp.getClients().Count < Configs.MAX_CLIENTS_PER_CASH) { if (store.getWaitingQueueSize() > 0) { Client c = store.getWaitQueue().ElementAt(0); store.getWaitQueue().RemoveAt(0); sp.AddClient(c); } else // Fail safe in case the wait queue ends up not having anyone in there when trying to fill up a new cash { break; } } }*/ List<Client> toMove = new List<Client>(); foreach (StoreQueue queue in this.store.getWaitQueues()) { if (queue.ContainsServicePoint(sp)) { foreach (Client c in queue.getClients()) { if (sp.CanService(c)) { toMove.Add(c); } } } } foreach (Client c in toMove) { c.MoveToQueue(sp.getQueue()); } }
public ClientServicePointEventArgs(Client c, long tick, ServicePoint sp) : base(c, tick, sp.getQueue()) { this.servicePoint = sp; }
public override void RemoveServicePoint(ServicePoint s) { s.getQueue().RemoveParent(); this.service_points.Remove(s); }