fCraft.Map.ClearUpdateQueue C# (CSharp) Method

ClearUpdateQueue() public method

Clears all pending updates.
public ClearUpdateQueue ( ) : void
return void
        public void ClearUpdateQueue()
        {
            updates = new ConcurrentQueue<BlockUpdate>();
        }

Usage Example

Example #1
0
        internal void Update()
        {
            while (keepGoing)
            {
                foreach (UpdateTask task in updateTasks.Values)
                {
                    if (task.enabled && task.nextTime < DateTime.Now)
                    {
                        task.callback(task.param);
                        task.nextTime += TimeSpan.FromMilliseconds(task.interval);
                    }
                }

                if (requestLockDown)
                {
                    lockDown = true;
                    tasks.Restart();
                    requestLockDown = false;
                    Thread.Sleep(100);   // buffer time for all threads to catch up
                    map.ClearUpdateQueue();
                    lockDownReady = true;
                }

                Thread.Sleep(1);
            }
        }
All Usage Examples Of fCraft.Map::ClearUpdateQueue