Implements

Constructors

Properties

history: State<any>[] = []
id: string = ...
locked?: boolean
parent?: string

Accessors

  • get state(): State<any>
  • It returns the last element of the history array

    Returns State<any>

    The last element in the array.

  • get status(): Status
  • If the state is not null, return the status of the state. Otherwise, return the status of the ready state

    Returns Status

    The status of the state.

  • set status(status): void
  • The function takes in a status and sets the status of the state to the status that was passed in

    Parameters

    • status: Status

      The status of the current game.

    Returns void

Methods

  • If the status is equal to the Paused value, then return true, otherwise return false.

    Returns boolean

    A boolean value.

  • If the status property of the current instance is equal to the Ready constant, return true, otherwise return false.

    Returns boolean

    A boolean value.

  • Pop the last item from the history array and return the lates state at history array.

    Returns undefined | false | State<any>

    The poped state object.

  • If the status is paused, set the status to ready

    Parameters

    • force: boolean = false

    Returns Token

    The current instance of the class.

  • It serializes the object.

    Parameters

    • options: {
          value: boolean;
      } = ...

      value: true

      • value: boolean

    Returns {
        history: {
            name?: string;
            ref: string;
            status: Status;
            value?: any;
        }[];
        id: string;
        locked?: boolean;
        parent?: string;
    }

    An object with the id, parent, history, and locked properties.

    • history: {
          name?: string;
          ref: string;
          status: Status;
          value?: any;
      }[]
    • id: string
    • Optional locked?: boolean
    • Optional parent?: string
  • It creates a new instance of the Token class.

    Parameters

    • Optional options: Partial<TokenInterface>

      The options object that will be passed to the constructor.

    Returns Token

    A new instance of the Token class.

  • It takes a JSON object and returns a new Token object with the same properties as the JSON object, except that the history property is an array of State objects instead of an array of JSON objects

    Parameters

    • token: TokenInterface

      Token - this is the data that is passed in from the deserialize function.

    Returns Token

    A new Token object with the data passed in and the history mapped to State objects.

Generated using TypeDoc