Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

getStateType

getStateType<Context, Schema, Event, EP>: Pick<StateMachine<Context, Schema, GameEventType<EP>>["initialState"], "value" | "context">

Type parameters

  • Context

  • Schema: StateSchema

  • Event: string | number

  • EP: EventPayloads<Event>

Variables

d

d: Debug & { debug: Debug; default: Debug }

Functions

Const defineGame

  • defineGame<State, Event, EP>(__namedParameters: { events: undefined | EventHandlers<State, Event, EP>; filter: undefined | ((state: State, player: Player) => State); initialState: State }): {}
  • Type parameters

    Parameters

    • __namedParameters: { events: undefined | EventHandlers<State, Event, EP>; filter: undefined | ((state: State, player: Player) => State); initialState: State }
      • events: undefined | EventHandlers<State, Event, EP>

        事件处理方法

      • filter: undefined | ((state: State, player: Player) => State)

        滤镜(玩家在客户端能看到状态与游戏状态的映射关系)

      • initialState: State

        游戏初始状态

    Returns {}

Const defineReduxGame

  • defineReduxGame<State, Action, Event, EP>(__namedParameters: { events: undefined | ReduxEventHandlers<State, Event, EP, Action>; filter: undefined | ((state: State, player: Player) => State); reducer: Reducer<State, Action> }): {}
  • Type parameters

    • State: {}

    • Action: ReduxAction

    • Event: string | number

    • EP: EventPayloads<Event>

    Parameters

    • __namedParameters: { events: undefined | ReduxEventHandlers<State, Event, EP, Action>; filter: undefined | ((state: State, player: Player) => State); reducer: Reducer<State, Action> }
      • events: undefined | ReduxEventHandlers<State, Event, EP, Action>

        事件处理方法

      • filter: undefined | ((state: State, player: Player) => State)

        滤镜(玩家在客户端能看到状态与游戏状态的映射关系)

      • reducer: Reducer<State, Action>

        游戏状态转移规则

    Returns {}

Const defineXStateGame

  • defineXStateGame<Context, Schema, Event, EP>(__namedParameters: { filter: undefined | ((state: getStateType<Context, Schema, Event, EP>, player: Player) => getStateType<Context, Schema, Event, EP>); machine: StateMachine<Context, Schema, GameEventType<EP>, { context: TContext; value: any }> }): { constructor: any }
  • Type parameters

    • Context

    • Schema: StateSchema

    • Event: string | number

    • EP: EventPayloads<Event>

    Parameters

    • __namedParameters: { filter: undefined | ((state: getStateType<Context, Schema, Event, EP>, player: Player) => getStateType<Context, Schema, Event, EP>); machine: StateMachine<Context, Schema, GameEventType<EP>, { context: TContext; value: any }> }
      • filter: undefined | ((state: getStateType<Context, Schema, Event, EP>, player: Player) => getStateType<Context, Schema, Event, EP>)

        滤镜(玩家在客户端能看到状态与游戏状态的映射关系)

      • machine: StateMachine<Context, Schema, GameEventType<EP>, { context: TContext; value: any }>

    Returns { constructor: any }

    • constructor: function
      • new __type(room: Room, masterClient: Client): XStateGame<Context, Schema, Event, EP>

Legend

  • Object literal
  • Variable
  • Function with type parameter
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Enumeration
  • Class with type parameter

Generated using TypeDoc