Table of Contents

Class NetworkStack<T>

Namespace
Netick
Assembly
Netick.dll

A networked Stack<T> collection.

public sealed class NetworkStack<T> : NetworkStack, INetworkCollection, IEnumerable<T>, IEnumerable where T : unmanaged

Type Parameters

T
Inheritance
NetworkStack<T>
Implements
Inherited Members

Constructors

NetworkStack(int)

public NetworkStack(int capacity)

Parameters

capacity int

Properties

Count

Gets the number of items contained in the stack.

public int Count { get; }

Property Value

int

Methods

Add(T)

Adds an item to the original stack (used for internal state).

public void Add(T item)

Parameters

item T

The element to add.

Clear()

Removes all items from the stack.

public void Clear()

GetEnumerator()

public NetworkStack<T>.Enumerator GetEnumerator()

Returns

NetworkStack<T>.Enumerator

InternalInit(INetickNetworkScript, int*, int, int)

public override void InternalInit(INetickNetworkScript beh, int* state, int elementSizeWords, int flags)

Parameters

beh INetickNetworkScript
state int*
elementSizeWords int
flags int

InternalReset()

public override void InternalReset()

Peek()

Returns the item at the top of the stack without removing it.

public T Peek()

Returns

T

The item at the top of the stack, or default if the stack is empty.

Pop()

Removes and returns the item at the top of the stack.

public T Pop()

Returns

T

The item removed from the top of the stack, or default if the stack is empty.

Push(T)

Pushes an item onto the top of the stack.

public bool Push(T item)

Parameters

item T

The item to push onto the stack.

Returns

bool

True if the item was pushed; false if the stack is full.

TryPeek(out T)

Attempts to return the item at the top of the stack without removing it.

public bool TryPeek(out T result)

Parameters

result T

The item at the top of the stack, or default if the stack is empty.

Returns

bool

True if an item was returned; otherwise, false.

TryPop(out T)

Attempts to remove and return the item at the top of the stack.

public bool TryPop(out T result)

Parameters

result T

The item removed from the top of the stack, or default if the stack is empty.

Returns

bool

True if an item was removed; otherwise, false.