Ejemplo n.º 1
0
        Order OrderSelectorFromActualPool()
        {
            // Select random order
            var returnOrder = ActualOrderPool[Rand.Next(0, ActualOrderPool.Count - 1)] ?? throw new IndexOutOfRangeException();

            // Remove it from transfer pool
            ActualOrderPool.Remove(returnOrder);

            // Return it
            return(returnOrder);
        }
Ejemplo n.º 2
0
        // Check every tick if the timer hits 0
        void PoolTimeChecker()
        {
            // Check if timer is <= 0
            if (PoolTimer <= 0)
            {
                // Move current pool to actualPool
                InitialOrderPool.ForEach(o => ActualOrderPool.Add(o));
                InitialOrderPool.Clear();

                ResetTimer();
            }
            else
            {
                // Decrement timer
                PoolTimer--;
            }

            // If there is something in the current pool
            if (ActualOrderPool.Any())
            {
                // Push it to the handler one element per tick
                OrderToHandlerMover();
            }
        }