Dungeon Architect
17.0.0
|
Typical FIFO generic stack container that stores data inside of a fixed-size internal buffer (array). More...
Public Member Functions | |
BufferedStack (int size) | |
Initializes a new instance of the BufferedStack<T> class. More... | |
BufferedStack (int size, ICollection< T > items) | |
Initializes a new instance of the BufferedStack<T> class as a copy of an ICollection<T> of the same type. More... | |
bool | Push (T item) |
Pushes a new element to the top of the stack. More... | |
T | Pop () |
Removes most recent (top) element from stack and returns it. More... | |
T | Peek () |
Returns copy of the top element of the stack. More... | |
void | Clear () |
Resets stack pointer back to default, essentially clearing the stack. More... | |
bool | Contains (T item) |
Returns whether the stack contains a given item. More... | |
void | CopyTo (T[] array, int arrayIndex) |
Copies the contents of the BufferedStack<T> to an array. More... | |
IEnumerator< T > | GetEnumerator () |
Gets the BufferedStack's enumerator. More... | |
Properties | |
int | Count [get] |
Gets the number of elements in the stack. More... | |
T | this[int index] [get] |
Gets the value at specified index (valid ranges are from 0 to size-1) More... | |
Typical FIFO generic stack container that stores data inside of a fixed-size internal buffer (array).
T | Type of element that given BufferedStack object stores. |
Definition at line 16 of file BufferedStack.cs.
SharpNav.Collections.Generic.BufferedStack< T >.BufferedStack | ( | int | size | ) |
Initializes a new instance of the BufferedStack<T> class.
size | The maximum number of items that will be stored. |
Definition at line 25 of file BufferedStack.cs.
SharpNav.Collections.Generic.BufferedStack< T >.BufferedStack | ( | int | size, |
ICollection< T > | items | ||
) |
Initializes a new instance of the BufferedStack<T> class as a copy of an ICollection<T> of the same type.
size | The number of elements to copy from the collection. |
items | The collection to copy from. |
Definition at line 37 of file BufferedStack.cs.
void SharpNav.Collections.Generic.BufferedStack< T >.Clear | ( | ) |
Resets stack pointer back to default, essentially clearing the stack.
Definition at line 127 of file BufferedStack.cs.
bool SharpNav.Collections.Generic.BufferedStack< T >.Contains | ( | T | item | ) |
Returns whether the stack contains a given item.
item | Item to search for |
Definition at line 137 of file BufferedStack.cs.
void SharpNav.Collections.Generic.BufferedStack< T >.CopyTo | ( | T[] | array, |
int | arrayIndex | ||
) |
Copies the contents of the BufferedStack<T> to an array.
array | The array to copy to. |
arrayIndex | The index within the array to start copying to. |
Definition at line 151 of file BufferedStack.cs.
IEnumerator<T> SharpNav.Collections.Generic.BufferedStack< T >.GetEnumerator | ( | ) |
Gets the BufferedStack's enumerator.
Definition at line 160 of file BufferedStack.cs.
T SharpNav.Collections.Generic.BufferedStack< T >.Peek | ( | ) |
Returns copy of the top element of the stack.
Definition at line 116 of file BufferedStack.cs.
T SharpNav.Collections.Generic.BufferedStack< T >.Pop | ( | ) |
Removes most recent (top) element from stack and returns it.
Definition at line 104 of file BufferedStack.cs.
bool SharpNav.Collections.Generic.BufferedStack< T >.Push | ( | T | item | ) |
Pushes a new element to the top of the stack.
item | The element to be added to the stack |
Definition at line 92 of file BufferedStack.cs.
|
get |
Gets the number of elements in the stack.
Definition at line 55 of file BufferedStack.cs.
|
get |
Gets the value at specified index (valid ranges are from 0 to size-1)
index | Index value |
Definition at line 79 of file BufferedStack.cs.