DC/RTS Documentation  v1.62
A Unity3D System Incorporating the Functionality of a Dungeon Crawler or Real Time Strategy System
 All Classes Files Functions Variables Enumerations Enumerator Properties Pages
BinaryHeap< T > Class Template Reference

BinaryHeap used from: http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=789 More...

Inheritance diagram for BinaryHeap< T >:

Public Member Functions

 BinaryHeap ()
 Creates a BinaryHeap with a Default IComparer. More...
 
 BinaryHeap (IComparer< T > comp)
 Creates a BinaryHeap with a Custom IComparer. More...
 
void Clear ()
 Removes All Items from the Collection. More...
 
void TrimExcess ()
 Sets the Capacity to the Actual Number of Elements in the BinaryHeap, if that Number is Less Than a Threshold Value. More...
 
void Insert (T newItem)
 Inserts an Item onto the Heap. More...
 
bool Contains (T item)
 Return the Root Item from the Collection, without Removing it. More...
 
Peek ()
 Returns the Item at the Top of the BinaryHeap. More...
 
RemoveRoot ()
 Removes and Returns the Root Item from the Collection. More...
 
IEnumerator GetEnumerator ()
 

Properties

int Count [get]
 Get a Count of the Number of Items in the Collection. More...
 

Detailed Description

BinaryHeap used from: http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=789

Selects and Bubbles Smallest Object on Top of Heap.

Template Parameters
TAny Object that can be Sorted.

Constructor & Destructor Documentation

BinaryHeap< T >.BinaryHeap ( )

Creates a BinaryHeap with a Default IComparer.

BinaryHeap< T >.BinaryHeap ( IComparer< T >  comp)

Creates a BinaryHeap with a Custom IComparer.

Parameters
comp

Member Function Documentation

void BinaryHeap< T >.Clear ( )

Removes All Items from the Collection.

bool BinaryHeap< T >.Contains ( item)

Return the Root Item from the Collection, without Removing it.

Returns
Returns the Item at the Root of the Heap.
IEnumerator BinaryHeap< T >.GetEnumerator ( )
void BinaryHeap< T >.Insert ( newItem)

Inserts an Item onto the Heap.

Parameters
newItemThe Item to be Inserted.
T BinaryHeap< T >.Peek ( )

Returns the Item at the Top of the BinaryHeap.

T BinaryHeap< T >.RemoveRoot ( )

Removes and Returns the Root Item from the Collection.

Returns
Returns the Item at the Root of the Heap.
void BinaryHeap< T >.TrimExcess ( )

Sets the Capacity to the Actual Number of Elements in the BinaryHeap, if that Number is Less Than a Threshold Value.

The current threshold value is 90% (.NET 3.5), but might change in a future release.

Property Documentation

int BinaryHeap< T >.Count
get

Get a Count of the Number of Items in the Collection.


The documentation for this class was generated from the following file: