M&B: Bannerlord 1.2.10
The horns sound, the ravens gather.
|
Priority queue based on binary heap, Elements with minimum priority dequeued first. More...
Inherits ICollection< KeyValuePair< TPriority, TValue > >.
Public Member Functions | |
PriorityQueue () | |
Initializes a new instance of priority queue with default initial capacity and default priority comparer. | |
PriorityQueue (int capacity) | |
Initializes a new instance of priority queue with specified initial capacity and default priority comparer. | |
PriorityQueue (int capacity, IComparer< TPriority > comparer) | |
Initializes a new instance of priority queue with specified initial capacity and specified priority comparer. | |
PriorityQueue (IComparer< TPriority > comparer) | |
Initializes a new instance of priority queue with default initial capacity and specified priority comparer. | |
PriorityQueue (IEnumerable< KeyValuePair< TPriority, TValue > > data) | |
Initializes a new instance of priority queue with specified data and default priority comparer. | |
PriorityQueue (IEnumerable< KeyValuePair< TPriority, TValue > > data, IComparer< TPriority > comparer) | |
Initializes a new instance of priority queue with specified data and specified priority comparer. | |
void | Enqueue (TPriority priority, TValue value) |
Enqueues element into priority queue. | |
KeyValuePair< TPriority, TValue > | Dequeue () |
Dequeues element with minimum priority and return its priority and value as KeyValuePair<TPriority,TValue> | |
TValue | DequeueValue () |
Dequeues element with minimum priority and return its value. | |
KeyValuePair< TPriority, TValue > | Peek () |
Returns priority and value of the element with minimun priority, without removing it from the queue. | |
TValue | PeekValue () |
Returns value of the element with minimun priority, without removing it from the queue. | |
void | Add (KeyValuePair< TPriority, TValue > item) |
Enqueues element into priority queue. | |
void | Clear () |
Clears the collection. | |
bool | Contains (KeyValuePair< TPriority, TValue > item) |
Determines whether the priority queue contains a specific element. | |
void | CopyTo (KeyValuePair< TPriority, TValue >[] array, int arrayIndex) |
Copies the elements of the priority queue to an Array, starting at a particular Array index. | |
bool | Remove (KeyValuePair< TPriority, TValue > item) |
Removes the first occurrence of a specific object from the priority queue. | |
IEnumerator< KeyValuePair< TPriority, TValue > > | GetEnumerator () |
Returns an enumerator that iterates through the collection. | |
Static Public Member Functions | |
static PriorityQueue< TPriority, TValue > | MergeQueues (PriorityQueue< TPriority, TValue > pq1, PriorityQueue< TPriority, TValue > pq2) |
Merges two priority queues. | |
static PriorityQueue< TPriority, TValue > | MergeQueues (PriorityQueue< TPriority, TValue > pq1, PriorityQueue< TPriority, TValue > pq2, IComparer< TPriority > comparer) |
Merges two priority queues and sets specified comparer for resultant priority queue. | |
Properties | |
bool | IsEmpty [get] |
Gets whether priority queue is empty. | |
int | Count [get] |
Gets number of elements in the priority queue. | |
bool | IsReadOnly [get] |
Gets a value indicating whether the collection is read-only. | |
TPriority | Type of priorities |
TValue | Type of values |
TaleWorlds.Library.PriorityQueue< TPriority, TValue >.PriorityQueue | ( | ) |
TaleWorlds.Library.PriorityQueue< TPriority, TValue >.PriorityQueue | ( | int | capacity | ) |
capacity | initial capacity |
TaleWorlds.Library.PriorityQueue< TPriority, TValue >.PriorityQueue | ( | int | capacity, |
IComparer< TPriority > | comparer ) |
capacity | initial capacity |
comparer | priority comparer |
TaleWorlds.Library.PriorityQueue< TPriority, TValue >.PriorityQueue | ( | IComparer< TPriority > | comparer | ) |
comparer | priority comparer |
TaleWorlds.Library.PriorityQueue< TPriority, TValue >.PriorityQueue | ( | IEnumerable< KeyValuePair< TPriority, TValue > > | data | ) |
data | data to be inserted into priority queue |
TaleWorlds.Library.PriorityQueue< TPriority, TValue >.PriorityQueue | ( | IEnumerable< KeyValuePair< TPriority, TValue > > | data, |
IComparer< TPriority > | comparer ) |
data | data to be inserted into priority queue |
comparer | priority comparer |
|
static |
pq1 | first priority queue |
pq2 | second priority queue |
source priority queues must have equal comparers, otherwise InvalidOperationException will be thrown
|
static |
pq1 | first priority queue |
pq2 | second priority queue |
comparer | comparer for resultant priority queue |
void TaleWorlds.Library.PriorityQueue< TPriority, TValue >.Enqueue | ( | TPriority | priority, |
TValue | value ) |
priority | element priority |
value | element value |
KeyValuePair< TPriority, TValue > TaleWorlds.Library.PriorityQueue< TPriority, TValue >.Dequeue | ( | ) |
Method throws InvalidOperationException if priority queue is empty
TValue TaleWorlds.Library.PriorityQueue< TPriority, TValue >.DequeueValue | ( | ) |
Method throws InvalidOperationException if priority queue is empty
KeyValuePair< TPriority, TValue > TaleWorlds.Library.PriorityQueue< TPriority, TValue >.Peek | ( | ) |
Method throws InvalidOperationException if priority queue is empty
TValue TaleWorlds.Library.PriorityQueue< TPriority, TValue >.PeekValue | ( | ) |
Method throws InvalidOperationException if priority queue is empty
void TaleWorlds.Library.PriorityQueue< TPriority, TValue >.Add | ( | KeyValuePair< TPriority, TValue > | item | ) |
item | element to add |
void TaleWorlds.Library.PriorityQueue< TPriority, TValue >.Clear | ( | ) |
bool TaleWorlds.Library.PriorityQueue< TPriority, TValue >.Contains | ( | KeyValuePair< TPriority, TValue > | item | ) |
item | The object to locate in the priority queue |
true
if item is found in the priority queue; otherwise, false.
void TaleWorlds.Library.PriorityQueue< TPriority, TValue >.CopyTo | ( | KeyValuePair< TPriority, TValue >[] | array, |
int | arrayIndex ) |
array | The one-dimensional Array that is the destination of the elements copied from the priority queue. The Array must have zero-based indexing. |
arrayIndex | The zero-based index in array at which copying begins. |
It is not guaranteed that items will be copied in the sorted order.
bool TaleWorlds.Library.PriorityQueue< TPriority, TValue >.Remove | ( | KeyValuePair< TPriority, TValue > | item | ) |
item | The object to remove from the ICollection <(Of <(T >)>). |
true
if item was successfully removed from the priority queue. This method returns false if item is not found in the collection. IEnumerator< KeyValuePair< TPriority, TValue > > TaleWorlds.Library.PriorityQueue< TPriority, TValue >.GetEnumerator | ( | ) |
Returned enumerator does not iterate elements in sorted order.
|
get |
|
get |
|
get |
For priority queue this property returns false
.