public void RemoveBuildUnit(PriorityQueueNode <AssetBuildUnit> node) { lock (queueLock) { queue.Remove(node); } }
internal void Unschedule(PriorityQueueNode <SchedulerEntry> schedulerEntry) { lock (ScheduledEntries) { if (schedulerEntry.Index != -1) { ScheduledEntries.Remove(schedulerEntry); } } }
public void TestRemoval() { var priorityQueue = new PriorityNodeQueue<int>(); List<PriorityQueueNode<int>> nodes = new List<PriorityQueueNode<int>>(); for (int i = 0; i < 1000; ++i) { nodes.Add(priorityQueue.Enqueue(i)); } priorityQueue.Remove(nodes[3]); priorityQueue.Remove(nodes[0]); priorityQueue.Remove(nodes[500]); priorityQueue.Remove(nodes[251]); priorityQueue.Remove(nodes[999]); Assert.That(priorityQueue.Count, Is.EqualTo(1000 - 5)); CheckPriorityQueue(priorityQueue); }
public void TestRemoval() { var priorityQueue = new PriorityNodeQueue <int>(); List <PriorityQueueNode <int> > nodes = new List <PriorityQueueNode <int> >(); for (int i = 0; i < 1000; ++i) { nodes.Add(priorityQueue.Enqueue(i)); } priorityQueue.Remove(nodes[3]); priorityQueue.Remove(nodes[0]); priorityQueue.Remove(nodes[500]); priorityQueue.Remove(nodes[251]); priorityQueue.Remove(nodes[999]); Assert.Equal(1000 - 5, priorityQueue.Count); CheckPriorityQueue(priorityQueue); }