Dungeon Architect  17.0.0
SharpNav.Collections.Generic.BufferedQueue< T > Class Template Reference

Typical LIFO generic queue container that stores data inside of a fixed-size internal buffer (array). More...

Inheritance diagram for SharpNav.Collections.Generic.BufferedQueue< T >:

Public Member Functions

 BufferedQueue (int size)
 Initializes a new instance of the BufferedQueue<T> class. More...
 
 BufferedQueue (ICollection< T > items)
 Initializes a new instance of the BufferedQueue<T> class as a copy of an ICollection<T> of the same type. More...
 
bool Enqueue (T item)
 Adds a new element to the front of the queue. More...
 
Dequeue ()
 Removes bottom element from queue and returns it (and updates "first" index) More...
 
Peek ()
 Returns last element in the queue More...
 
void Clear ()
 Resets queue pointer back to default, essentially clearing the queue. More...
 
bool Contains (T item)
 Returns whether the queue contains a given item. More...
 
void CopyTo (T[] array, int arrayIndex)
 Copies the contents of the BufferedQueue<T> to an array. More...
 
IEnumerator< T > GetEnumerator ()
 Gets the BufferedQueue's enumerator. More...
 

Properties

int? Count [get]
 Gets the number of elements in the queue. More...
 
this[int index] [get]
 Gets the value at specified index (valid ranges are from 0 to size-1) More...
 

Detailed Description

Typical LIFO generic queue container that stores data inside of a fixed-size internal buffer (array).

Template Parameters
TType of element that given BufferedQueue object stores.

Definition at line 16 of file BufferedQueue.cs.

Constructor & Destructor Documentation

◆ BufferedQueue() [1/2]

Initializes a new instance of the BufferedQueue<T> class.

Parameters
sizeThe maximum number of items that will be stored.

Definition at line 27 of file BufferedQueue.cs.

◆ BufferedQueue() [2/2]

Initializes a new instance of the BufferedQueue<T> class as a copy of an ICollection<T> of the same type.

Parameters
itemsThe collection to copy from.

Definition at line 38 of file BufferedQueue.cs.

Member Function Documentation

◆ Clear()

Resets queue pointer back to default, essentially clearing the queue.

Definition at line 128 of file BufferedQueue.cs.

◆ Contains()

bool SharpNav.Collections.Generic.BufferedQueue< T >.Contains ( item)

Returns whether the queue contains a given item.

Parameters
itemItem to search for
Returns
True if item exists in queue, False if not

Definition at line 138 of file BufferedQueue.cs.

◆ CopyTo()

void SharpNav.Collections.Generic.BufferedQueue< T >.CopyTo ( T[]  array,
int  arrayIndex 
)

Copies the contents of the BufferedQueue<T> to an array.

Parameters
arrayThe array to copy to.
arrayIndexThe index within the array to start copying to.

Definition at line 152 of file BufferedQueue.cs.

◆ Dequeue()

Removes bottom element from queue and returns it (and updates "first" index)

Returns
Bottom element

Definition at line 107 of file BufferedQueue.cs.

◆ Enqueue()

bool SharpNav.Collections.Generic.BufferedQueue< T >.Enqueue ( item)

Adds a new element to the front of the queue.

Parameters
itemThe element to be added to the queue
Returns
True if element was added to queue, False otherwise

Definition at line 93 of file BufferedQueue.cs.

◆ GetEnumerator()

IEnumerator<T> SharpNav.Collections.Generic.BufferedQueue< T >.GetEnumerator ( )

Gets the BufferedQueue's enumerator.

Returns
The enumerator.

Definition at line 161 of file BufferedQueue.cs.

◆ Peek()

Returns last element in the queue

Returns
size element

Definition at line 118 of file BufferedQueue.cs.

Property Documentation

◆ Count

Gets the number of elements in the queue.

Definition at line 56 of file BufferedQueue.cs.

◆ this[int index]

T SharpNav.Collections.Generic.BufferedQueue< T >.this[int index]
get

Gets the value at specified index (valid ranges are from 0 to size-1)

Parameters
indexIndex value
Returns
The value at the index

Definition at line 80 of file BufferedQueue.cs.


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