• Returns a random enum entry.

    Type Parameters

    • T

    Parameters

    • enumObject: T

      The full enumeration. EG: ItemType, CreatureType, DoodadType, etc

    • random: Random<IRandomGenerator<any>>

      The random instance to use. Defaults to seeded random. Note that using this method in non-game locations may cause seed desyncs!

    • Optional filter: ((value: T[keyof T], index: number) => boolean)

      Repeats the choice until the random value matches the filter

        • (value: T[keyof T], index: number): boolean
        • Parameters

          • value: T[keyof T]
          • index: number

          Returns boolean

    Returns Exclude<T[keyof T], AnyFunction>

Generated using TypeDoc