Handles the state of a MotionManager.

Hierarchy

  • MotionState

Constructors

Properties

currentGroup?: string

Group of current motion.

currentIndex?: number

Index of current motion in its group.

currentPriority: MotionPriority = MotionPriority.NONE

Priority of the current motion. Will be MotionPriority.NONE if there's no playing motion.

debug: boolean = false

When enabled, the states will be dumped to the logger when an exception occurs.

reservePriority: MotionPriority = MotionPriority.NONE

Priority of the reserved motion, which is still in loading and will be played once loaded. Will be MotionPriority.NONE if there's no reserved motion.

reservedGroup?: string

Group of the reserved motion.

reservedIdleGroup?: string

Group of the reserved idle motion.

reservedIdleIndex?: number

Index of the reserved idle motion in its group.

reservedIndex?: number

Index of the reserved motion in its group.

tag: string

Tag for logging.

Methods

  • Dumps the state for debugging.

    Parameters

    • Optional requestedGroup: string
    • Optional requestedIndex: number

    Returns string

  • Checks if a Motion is currently playing or has reserved.

    Returns

    True if active.

    Parameters

    • group: string
    • index: number

    Returns boolean

  • Reserves the playback for a motion.

    Returns

    True if the reserving has succeeded.

    Parameters

    • group: string

      The motion group.

    • index: number

      Index in the motion group.

    • priority: MotionPriority

      The priority to be applied.

    Returns boolean

  • Sets the reserved idle motion.

    Parameters

    • group: undefined | string
    • index: undefined | number

    Returns void

  • Requests the playback for a motion.

    Returns

    True if the request has been approved, i.e. the motion is allowed to play.

    Parameters

    • motion: any

      The Motion, can be undefined.

    • group: string

      The motion group.

    • index: number

      Index in the motion group.

    • priority: MotionPriority

      The priority to be applied.

    Returns boolean

Generated using TypeDoc