Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Random

Index

Variables

debug

debug: boolean = false

history

history: IRandomHistory[] | undefined

pushedSeeds

pushedSeeds: IRandomPushed[] = []

seed

seed: number

Functions

generateSeed

  • generateSeed(): void
  • Returns void

getSeed

  • getSeed(): number
  • Returns number

nextBool

  • nextBool(): boolean
  • Generates a random boolean

    Returns boolean

nextChoice

  • nextChoice(from: any[]): any
  • Chooses a random entry in an array and returns it

    Parameters

    • from: any[]

    Returns any

nextFloat

  • nextFloat(max?: number): number
  • Parameters

    • Default value max: number = 1

    Returns number

nextInt

  • nextInt(max: number): number
  • Generates a random integer between 0 (inclusive) and max (exclusive)

    Parameters

    • max: number

    Returns number

nextIntInRange

  • nextIntInRange(min: number, max: number): number
  • Generates a random integer between min and max (inclusive)

    Parameters

    • min: number
    • max: number

    Returns number

popSeed

  • popSeed(): number
  • Returns number

pushSeed

  • pushSeed(newSeed?: number): void
  • Parameters

    • Optional newSeed: number

    Returns void

setDebug

  • setDebug(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

setSeed

  • setSeed(newSeed: number): void
  • Parameters

    • newSeed: number

    Returns void

shuffle

  • shuffle(array: number[]): Array<number>
  • Parameters

    • array: number[]

    Returns Array<number>

startHistory

  • startHistory(): void
  • Returns void

stopHistory

tickSeed

  • tickSeed(s: number): number
  • Parameters

    • s: number

    Returns number

Generated using TypeDoc