Options
All
  • Public
  • Public/Protected
  • All
Menu

Typesafe way of using the JS-based State Managers from soundworks on client side. A client can ...

  • ... SET the INPUTs
  • ... GET the STATEs explicitly (pull by client method)
  • ... GET the STATEs implicitly on every change (push by server method)

Hierarchy

  • ClientStateGuard

Index

Constructors

constructor

Properties

controllerInput

controllerInput: any = ...

A state that is used to send inputs from a controller client (e.g. changed module settings) to the controller server, where the input is processed.

playerInput

playerInput: any = ...

A state that is used to send inputs from a player client (e.g. interaction with a module) to the player server, where the input is processed.

sharedAppState

sharedAppState: any = ...

State Manager that distributes settings for the whole app that concern controllers and players. Can only be changed on server side.

sharedAppStateCallback

sharedAppStateCallback: (s: SharedAppType) => void = ...

Type declaration

    • Function that is called when the app state changes. Has to be set in controller or player client experience, outputs an error when not initialized.

      Parameters

      Returns void

sharedControllerState

sharedControllerState: any = ...

State Manager that distributes settings that concern controllers. Can only be changed on server side.

sharedControllerStateCallback

sharedControllerStateCallback: (s: SharedControllerType) => void = ...

Type declaration

    • Function that is called when the controller state changes. Has to be set in a controller client experience, outputs an error when not initialized.

      Parameters

      Returns void

sharedPlayerState

sharedPlayerState: any = ...

State Manager that distributes settings that concern players. Can only be changed on server side.

sharedPlayerStateCallback

sharedPlayerStateCallback: (s: SharedPlayerType) => void = ...

Type declaration

    • Function that is called when the player state changes. Has to be set in a player client experience, outputs an error when not initialized.

      Parameters

      Returns void

Methods

pullSharedAppState

  • pullSharedAppState(): void
  • Pull the app state which is then processed in the sharedAppStateCallback.

    Returns void

pullSharedControllerState

  • pullSharedControllerState(): void
  • Pull the controller state which is then processed in the sharedControllerCallback.

    Returns void

pullSharedPlayerState

  • pullSharedPlayerState(): void
  • Pull the player state which is then processed in the sharedControllerCallback.

    Returns void

receiveSharedAppState

  • receiveSharedAppState(state: object): void
  • Used as "person-in-the-middle" to ensure typesafety. Soundworks "state.subscribe()" method has to be registered with this function. It then get's forwarded, to the sharedAppStateCallback with correct type.

    Parameters

    • state: object

      The state as plain JS object type (build by a json string).

    Returns void

receiveSharedControllerState

  • receiveSharedControllerState(state: object): void
  • Used as "person-in-the-middle" to ensure typesafety. Soundworks "state.subscribe()" method has to be registered with this function. It then get's forwarded, to the sharedControllerStateCallback with correct type.

    Parameters

    • state: object

      The state as plain JS object type (build by a json string).

    Returns void

receiveSharedPlayerState

  • receiveSharedPlayerState(state: object): void
  • Used as "person-in-the-middle" to ensure typesafety. Soundworks "state.subscribe()" method has to be registered with this function. It then get's forwarded, to the sharedPlayerStateCallback with correct type.

    Parameters

    • state: object

      The state as plain JS object type (build by a json string).

    Returns void

setControllerInput

  • Send inputs (via the ControllerInput state manager) from the controller client to the controller server via the where it's processed.

    Parameters

    Returns void

setPlayerInput

  • Send inputs (via the PlayerInput state manager) from the player client to the player server via the where it's processed.

    Parameters

    • state: PlayerInputType

      Holds information about inputs a player interacted with.

    Returns void

Generated using TypeDoc