Wraps a ScannedPixel to raise events on mutable property changes.

Type Parameters

Hierarchy (view full)

Implements

Constructors

Properties

isScannedPixelNotifier: true = true
ExtendedMutablePropsList: readonly (keyof ScannedPixel)[] = ...
MutablePropsList: readonly (keyof PixelInfo)[]

Accessors

  • get currentFaceIndex(): number
  • The 0-based index of the die face that is currently facing up.

    Returns number

    Remarks

    Indices are continuous and follow the numerical order of the die faces values.

    Example

    A D20 die will have face indices ranging from 0 to 19.
    Index 0 corresponds to face 1 and index 19 to face 20.

    D10 and D00 share the same face indices but have different face values.
    Index 0 corresponds to face 0 of both dice types.
    Index 9 corresponds to face 9 for a D10 and to face 90 for a D00.

    The fudge die returns the following indices:
    - O and 5 for the "+" face .
    - 1 and 4 for the "-" face.
    - 2 and 3 for the "blank" face.

Methods

  • Adds the given listener function for the specified property.

    Type Parameters

    • K extends string

    Parameters

    • propertyName: K

      The name of the property.

    • listener: EventReceiver<Type>

      The callback function.

    Returns void

  • Emit a Pixel event for the specified property. This function should be called by the concrete type whenever the a property's value changes.

    Type Parameters

    • K extends string

    Parameters

    • propertyName: K

      Event name.

    Returns void

  • Removes the given listener function for the specified property.

    Type Parameters

    • K extends string

    Parameters

    • propertyName: K

      The name of the property.

    • listener: EventReceiver<Type>

      The callback function to unregister.

    Returns void

Generated using TypeDoc