Search Results for

    Show / Hide Table of Contents

    PriorityQueue<TElement, TPriority> Class

    Namespace: Riptide.Utils
    Assembly: RiptideNetworking.dll

    Represents a collection of items that have a value and a priority. On dequeue, the item with the lowest priority value is removed.

    public class PriorityQueue<TElement, TPriority>
    Inheritance
    object
    PriorityQueue<TElement, TPriority>
    Type Parameters
    TElement

    Specifies the type of elements in the queue.

    TPriority

    Specifies the type of priority associated with enqueued elements.

    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()

    Constructors

    PriorityQueue(IComparer<TPriority>, int)

    Initializes a new instance of the PriorityQueue<TElement, TPriority> class with the specified custom priority comparer.

    PriorityQueue(int)

    Initializes a new instance of the PriorityQueue<TElement, TPriority> class.

    Properties

    Count

    Gets the number of elements contained in the PriorityQueue<TElement, TPriority>.

    Methods

    Clear()

    Removes all elements from the PriorityQueue<TElement, TPriority>.

    Dequeue()

    Removes and returns the lowest priority element.

    Enqueue(TElement, TPriority)

    Adds the specified element and associated priority to the PriorityQueue<TElement, TPriority>.

    Peek()

    Returns the lowest priority element.

    PeekPriority()

    Returns the priority of the lowest priority element.

    TryDequeue(out TElement, out TPriority)

    Removes the lowest priority element from the PriorityQueue<TElement, TPriority> and copies it and its associated priority to the element and priority arguments.

    • Improve this Doc
    • View Source
    • Support Riptide
    In This Article
    Back to top Copyright © Tom Weiland 2022
    Made with DocFX