Dungeon Architect
17.0.0
|
Use a priority queue (heap) to determine which node is more important. More...
Public Member Functions | |
PriorityQueue (int n) | |
Initializes a new instance of the PriorityQueue<T> class with a given capacity of size n. More... | |
void | Clear () |
Remove all the elements from the priority queue. More... | |
bool | Empty () |
Determines whether the priority queue is empty More... | |
T | Top () |
Return the node at the top of the heap. More... | |
T | Pop () |
Remove the node at the top of the heap. Then, move the bottommost node to the top and trickle down until the nodes are in order. More... | |
void | Push (T node) |
Add the node at the bottom of the heap and move it up until the nodes ae in order. More... | |
bool | Contains (T item) |
Returns whether the given item exists in the heap. More... | |
void | Modify (T node) |
Change the value of the node, which may involve some swapping of elements to maintain heap order. More... | |
void | CopyTo (T[] array, int arrayIndex) |
Copies the contents of the PriorityQueue<T> to an array. More... | |
IEnumerator< T > | GetEnumerator () |
Gets the PriorityQueue's enumerator. More... | |
Properties | |
int | Count [get] |
Gets the number of elements in the priority queue. More... | |
Use a priority queue (heap) to determine which node is more important.
T | A type that has a cost for each instance via the IValueWithCost interface. |
T | : | class | |
T | : | IValueWithCost |
Definition at line 15 of file PriorityQueue.cs.
SharpNav.Collections.Generic.PriorityQueue< T >.PriorityQueue | ( | int | n | ) |
Initializes a new instance of the PriorityQueue<T> class with a given capacity of size n.
n | The maximum number of nodes that can be stored. |
Definition at line 26 of file PriorityQueue.cs.
void SharpNav.Collections.Generic.PriorityQueue< T >.Clear | ( | ) |
Remove all the elements from the priority queue.
Definition at line 59 of file PriorityQueue.cs.
bool SharpNav.Collections.Generic.PriorityQueue< T >.Contains | ( | T | item | ) |
Returns whether the given item exists in the heap.
item | Item to look for |
Definition at line 113 of file PriorityQueue.cs.
void SharpNav.Collections.Generic.PriorityQueue< T >.CopyTo | ( | T[] | array, |
int | arrayIndex | ||
) |
Copies the contents of the PriorityQueue<T> to an array.
array | The array to copy to. |
arrayIndex | The index within the array to start copying to. |
Definition at line 143 of file PriorityQueue.cs.
bool SharpNav.Collections.Generic.PriorityQueue< T >.Empty | ( | ) |
Determines whether the priority queue is empty
Definition at line 68 of file PriorityQueue.cs.
IEnumerator<T> SharpNav.Collections.Generic.PriorityQueue< T >.GetEnumerator | ( | ) |
Gets the PriorityQueue's enumerator.
Definition at line 155 of file PriorityQueue.cs.
void SharpNav.Collections.Generic.PriorityQueue< T >.Modify | ( | T | node | ) |
Change the value of the node, which may involve some swapping of elements to maintain heap order.
node | The node to modify |
Definition at line 126 of file PriorityQueue.cs.
T SharpNav.Collections.Generic.PriorityQueue< T >.Pop | ( | ) |
Remove the node at the top of the heap. Then, move the bottommost node to the top and trickle down until the nodes are in order.
Definition at line 87 of file PriorityQueue.cs.
void SharpNav.Collections.Generic.PriorityQueue< T >.Push | ( | T | node | ) |
Add the node at the bottom of the heap and move it up until the nodes ae in order.
node | The node to add |
Definition at line 102 of file PriorityQueue.cs.
T SharpNav.Collections.Generic.PriorityQueue< T >.Top | ( | ) |
Return the node at the top of the heap.
Definition at line 77 of file PriorityQueue.cs.
|
get |
Gets the number of elements in the priority queue.
Definition at line 36 of file PriorityQueue.cs.