Table of Contents

Class UniqueQueue<T>

Namespace
Vintagestory.API.Datastructures
Assembly
VintagestoryAPI.dll

Same as your normal c# queue but ensures that every element is contained only once using a Hashset.

public class UniqueQueue<T> : IEnumerable<T>, IEnumerable

Type Parameters

T
Inheritance
UniqueQueue<T>
Implements
Inherited Members
Extension Methods

Constructors

UniqueQueue()

public UniqueQueue()

Properties

Count

Amount of elements in the queue

public int Count { get; }

Property Value

int

Methods

Clear()

Emptys the queue and the hashset

public void Clear()

Contains(T)

Check if given item is contained. Uses the hashset to find the item.

public bool Contains(T item)

Parameters

item T

Returns

bool

Dequeue()

Removes an item from the queue

public T Dequeue()

Returns

T

Enqueue(T)

Adds an item to the queue

public void Enqueue(T item)

Parameters

item T

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

An enumerator that can be used to iterate through the collection.

Peek()

Returns the first item in the queue without removing it.

public T Peek()

Returns

T