public override void Update(float delta) { while (currQueue.Count > 0) { var animation = currQueue.Dequeue().Value; nextQueue.Enqueue(animation.Owner.Depth, animation.QueueNode); animation.Advance(delta * animation.OwnerNode.EffectiveAnimationSpeed); } Toolbox.Swap(ref currQueue, ref nextQueue); }
public static void Resize(ref BucketQueue <T> queue, int newBucketCount) { var newQueue = new BucketQueue <T>(newBucketCount); while (queue.Count > 0) { var bucketIndex = queue.Peek().BucketIndex; newQueue.Enqueue(bucketIndex, queue.Dequeue()); } queue = newQueue; }