// 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(); } }
private void AddOrderToPool(Order order) { InitialOrderPool.Add(order); }