PokéRogue
    Preparing search index...

    Class PriorityQueue<T>Abstract

    Stores a list of elements.

    Dynamically updates ordering to always pop the highest "priority", based on implementation of reorder.

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    queue: T[] = []

    Methods

    • Parameters

      • Optionalcondition: (t: T) => boolean

      Returns undefined | T

      An element matching the condition function

    • Parameters

      • Optionalcondition: (t: T) => boolean

      Returns boolean

      Whether an element matching the condition function exists

    • Sealed

      Calls reorder and shifts the queue

      Returns undefined | T

      The front element of the queue after sorting, or undefined if the queue is empty

    • Removes the first element matching the condition

      Parameters

      • condition: (t: T) => boolean = ...

        An optional condition function (defaults to a function that always returns true)

      Returns boolean

      Whether a removal occurred