/// <summary> /// Create all objects /// </summary> private void CreateObj() { //waitingCP.Text = " "; //waitingAPlable.Text = " "; wQLabelAP.Text = " "; wQLabelCP.Text = " "; visitorLabelAP.Text = " "; visitorLabelCP.Text = " "; exitAP.Text = " "; exitCP.Text = " "; wQueueAP = new WaitingQueueAP(10, wQLabelAP); wQueueCP = new WaitingQueueCP(10, wQLabelCP); reception = new Reception(10, wQueueCP, wQueueAP); apPool = new AdventurePool(10, wQueueAP, visitorLabelAP, apPictureBox); cpPool = new CommonPool(10, apPool, wQueueAP, wQueueCP, visitorLabelCP, moveFromCPLabel, cpPictureBox); exitQueue = new ExitQueue(apPool, cpPool, exitCP, exitAP); apPictureBox.BackColor = Color.Green; cpPictureBox.BackColor = Color.Green; }
/// <summary> /// Constructor /// </summary> /// <param name="adPool"></param> /// <param name="cpPool"></param> /// <param name="label1"></param> /// <param name="label2"></param> public ExitQueue(AdventurePool adPool, CommonPool cpPool, Label label1, Label label2) { this.adPool = adPool; this.cpPool = cpPool; this.label1 = label1; this.label2 = label2; rnd = new Random(); exitQueue = new Queue <Customer>(); }
/// <summary> /// Constructor /// </summary> /// <param name="maxCapacity"></param> /// <param name="wQueueAP"></param> /// <param name="wQueueCP"></param> /// <param name="label1"></param> /// <param name="label2"></param> public CommonPool(int maxCapacity, AdventurePool adventurePool, WaitingQueueAP wQueueAP, WaitingQueueCP wQueueCP, Label label1, Label label2, PictureBox p1) { this.wQueueAP = wQueueAP; this.wQueueCP = wQueueCP; this.maxCapacity = maxCapacity; this.label1 = label1; this.label2 = label2; this.p1 = p1; apClass = adventurePool; myLock = new object(); rnd = new Random(); filled = false; empty = true; customerQueue = new Queue <Customer>(); }