A data structure for tracking a set of boolean status flags. This is a restricted set which can only accept flag values which are pre-defined.

Hierarchy

  • Set
    • RenderFlags

Constructors

Properties

Methods

Constructors

  • Parameters

    • Optionalflags: Record<string, RenderFlag> = {}

      An object which defines the flags which are supported for tracking

    • Optionalconfig: { object?: any; priority?: "OBJECTS" | "PERCEPTION" } = {}

      Optional configuration

      • Optionalobject?: any

        The object which owns this RenderFlags instance

      • Optionalpriority?: "OBJECTS" | "PERCEPTION"

        The ticker priority at which these render flags are handled

    Returns RenderFlags

Properties

flags: Readonly<Record<string, RenderFlag>>

The flags tracked by this data structure.

object: any

The RenderFlagObject instance which owns this set of RenderFlags

priority: "OBJECTS" | "PERCEPTION"

The update priority when these render flags are applied.

Methods

  • Returns Record<string, boolean>

    The flags which were previously set that have been cleared.

  • Allow for handling one single flag at a time. This function returns whether the flag needs to be handled and removes it from the pending set.

    Parameters

    • flag: string

    Returns boolean

  • Create a new Set where every element is modified by a provided transformation function.

    Type Parameters

    • U

    Parameters

    • transform: (element: string, index: number, set: Set<string>) => U

      The transformation function to apply. Positional arguments are the value, the index of iteration, and the set being transformed.

    Returns Set<U>

    A new Set of equal size containing transformed elements.

    Array#map

  • Create a new Set with elements that are filtered and transformed by a provided reducer function.

    Type Parameters

    • U

    Parameters

    • reducer: (accum: U, element: string, index: number, set: Set<string>) => U

      A reducer function applied to each value. Positional arguments are the accumulator, the value, the index of iteration, and the set being reduced.

    • Optionalinitial: U

      The initial value of the returned accumulator.

    Returns U

    The final value of the accumulator.

    Array#reduce

  • Activate certain flags, also toggling propagation and reset behaviors

    Parameters

    • changes: Record<string, boolean>

    Returns void