PokéRogue
    Preparing search index...
    • Filter a pool and return a new array of moves that pass the predicate

      Parameters

      • pool: ReadonlyMap<MoveId, number>

        The move pool to filter

      • predicate: (moveId: MoveId) => boolean

        The predicate function to determine if a move should be included

      • OptionaltotalWeight: NumberHolder<number>

        An output parameter to hold the total weight of the filtered pool. Its value is reset to 0 if provided.

      Returns [id: MoveId, weight: number][]

      An array of move ID and weight tuples that pass the predicate