Class Die<T>

A fair multi-faced die. For now, only 6 faced.

Type Parameters

  • T = number

Hierarchy

Constructors

Properties

_lastActionIndex: number
color: Color
faces: readonly IDieFace<T>[]
hiddenName?: string

Optional display name for this object when hidden.

name?: string

Optional display name for this object.

pipColor: Color
scale: number
DEFAULT_FACES_6: readonly IDieFace<number>[] = ...
DEFAULT_ROTATIONS_6: readonly Rotation[] = ...

Accessors

  • get faceIndex(): number
  • Returns number

  • get isRolling(): boolean
  • Returns boolean

  • get localBounds(): Bounds
  • How much space does this object take up.

    Returns Bounds

  • get value(): T
  • Returns T

  • set value(val): void
  • Parameters

    • val: T

    Returns void

Methods

  • Builds a view of this object from the perspective of a player.

    Parameters

    • ctx: RenderContext

      Information about where the object is in the scene, and who's viewing it.

    Returns DieView

  • Parameters

    • duration: number = 1

    Returns Promise<IDieFace<T>>

  • Returns void

Generated using TypeDoc