Bitbybit Docs
    Preparing search index...

    Class RandomThresholdDto<T> (Inputs.Lists)

    用于 lists.randomGetThresholdlists.randomRemoveThreshold 的列表和概率。

    Type Parameters

    • T
    Index

    Constructors

    Properties

    Constructors

    • Type Parameters

      • T

      Parameters

      • Optionallist: T[]
      • Optionalthreshold: number
      • Optionalclone: boolean

      Returns RandomThresholdDto<T>

    Properties

    list: T[]

    要从中挑选的列表。

    undefined
    
    threshold: number

    任一项被 get 方法保留或被 remove 方法丢弃的概率,从 0 到 1。

    0.5
    

    0

    1

    0.1

    clone?: boolean

    为 true 时,列表先被深拷贝,因此输入永远不会被更改。

    true