Table of Contents

Class NetworkQueue<T>

Namespace
Netick
Assembly
Netick.dll

A networked Queue<T> collection.

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

Type Parameters

T
Inheritance
NetworkQueue<T>
Implements
Inherited Members

Constructors

NetworkQueue(int)

public NetworkQueue(int capacity)

Parameters

capacity int

Properties

Count

Gets the number of elements contained in the queue.

public int Count { get; }

Property Value

int

Methods

Add(T)

Adds an item to the underlying original queue. Used for local operations.

public void Add(T item)

Parameters

item T

The item to add.

Clear()

Removes all elements from the queue.

public void Clear()

Dequeue()

Removes and returns the item at the beginning of the queue.

public T Dequeue()

Returns

T

The item removed from the beginning of the queue.

Exceptions

InvalidOperationException

Thrown if the queue is empty.

Enqueue(T)

Adds an item to the end of the queue if there is capacity.

public bool Enqueue(T item)

Parameters

item T

The item to add.

Returns

bool

true if the item was added; otherwise, false if the queue is full.

GetEnumerator()

public NetworkQueue<T>.Enumerator GetEnumerator()

Returns

NetworkQueue<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 beginning of the queue without removing it.

public T Peek()

Returns

T

The item at the beginning of the queue.

Exceptions

InvalidOperationException

Thrown if the queue is empty.

TryDequeue(out T)

Attempts to remove and return the item at the beginning of the queue.

public bool TryDequeue(out T result)

Parameters

result T

When this method returns, contains the object removed from the queue, or the default value if the queue is empty.

Returns

bool

true if an item was dequeued; otherwise, false.

TryPeek(out T)

Attempts to return the item at the beginning of the queue without removing it.

public bool TryPeek(out T result)

Parameters

result T

When this method returns, contains the object at the beginning of the queue, or the default value if the queue is empty.

Returns

bool

true if an item was found; otherwise, false.