Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

Const createGameClient

  • createGameClient<State, Event, EP>(__namedParameters: { client: Client; events: EventHandlers<State, Event, EP>; initialState: State }): GameClient<State, Event, EP>
  • 创建一个状态化的游戏客户端

    Type parameters

    Parameters

    • __namedParameters: { client: Client; events: EventHandlers<State, Event, EP>; initialState: State }
      • client: Client

        当前玩家的 Client

      • events: EventHandlers<State, Event, EP>

        客户端的事件处理方法

      • initialState: State

        游戏初始状态

    Returns GameClient<State, Event, EP>

Const createReduxGameClient

  • createReduxGameClient<State, Action, Event, EP>(__namedParameters: { client: Client; events: ReduxEventHandlers<State, Event, EP, Action>; reducer: Reducer<State, Action> }): ReduxGameClient<State, Action, Event, EP>
  • 创建一个使用 Redux 维护状态的游戏客户端

    Type parameters

    • State: {}

    • Action: ReduxAction

    • Event: string | number

    • EP: EventPayloads<Event>

    Parameters

    • __namedParameters: { client: Client; events: ReduxEventHandlers<State, Event, EP, Action>; reducer: Reducer<State, Action> }

    Returns ReduxGameClient<State, Action, Event, EP>

Object literals

Const ClientEvent

ClientEvent: object

Client Game 会派发的事件名称

STATE_UPDATE

STATE_UPDATE: string = "state-update"

state 更新了,游戏可以根据新的 state 更新 UI

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