Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DiscreteAction<ActionDataT>

Class that represents a discrete action that can be in one of two states, started or stopped for each user. @see ActionState

Type parameters

  • ActionDataT

Hierarchy

  • DiscreteAction

Implements

  • Actionable

Index

Methods

Methods

getState

  • Gets the current state of the action for the user with the given id.

    Parameters

    • user: User

      The user to get the action state for.

    Returns ActionState

    The current state of the action for the user.

isActive

  • isActive(user?: User): boolean
  • Get whether the action is active for the user with the given id.

    Parameters

    • Optional user: User

      The user to get whether the action is active for, or null if active for any user is desired..

    Returns boolean

    • True if the action is active for the user, false if it is not. In the case that no user is given, the value is true if the action is active for any user, and false if not.

on

  • Add a handler for the given action state for when it is triggered.

    Parameters

    • actionState: ActionState

      The action state that the handle should be assigned to.

    • handler: ActionHandler<ActionDataT>

      The handler to call when the action state is triggered.

    Returns this