public BallQueue(ref BallQueue NextQueue)
 {
     // Constructor for source queue
     maxQueueSize = null;
     nextQueue    = NextQueue;
     queue        = new List <Ball>();
 }
 public BallQueue(int MaxQueueSize, ref BallQueue ReturnQueue, ref BallQueue NextQueue)
 {
     maxQueueSize = MaxQueueSize; // Size of queue before triggering the 'advance' event
     nextQueue    = NextQueue;    // The next queue that the balls are passed to; if null, they are not advanced and returned to the source
     returnQueue  = ReturnQueue;
     queue        = new List <Ball>();
 }
 public BallQueue(int MaxQueueSize, ref BallQueue ReturnQueue)
 {
     // Constructor for 12 hour queue
     returnQueue  = ReturnQueue;
     maxQueueSize = MaxQueueSize;
     nextQueue    = null;
     queue        = new List <Ball>();
 }
Exemplo n.º 4
0
 public BallClockSimulator(int numberOfBalls)
 {
     // Creates each queue with the necessary constructors for each queue type
     sourceQueue     = new BallQueue(ref fiveMinuteQueue);                      // Balls in queue
     twelveHourQueue = new BallQueue(11, ref sourceQueue);                      // Balls in the 1 hour/ball queue
     oneHourQueue    = new BallQueue(11, ref sourceQueue, ref twelveHourQueue); // Balls in the 5 minute/ball queue
     fiveMinuteQueue = new BallQueue(4, ref sourceQueue, ref oneHourQueue);     // Balls in the 1 minute/ball queue; maxSize is 5,
     sourceQueue.SetNextQueue(ref fiveMinuteQueue);                             // Need to reset because first instance points at null fiveMinuteQueue
     createSourceQueue(numberOfBalls);
 }
 public void SetNextQueue(ref BallQueue NextQueue)
 {
     nextQueue = NextQueue;
 }