接口 GameFlowContext


public interface GameFlowContext
上下文 - 游戏流程上下文。
从以下版本开始:
21.8
作者:
渔民小镇
另请参阅:
日期:
2024-05-12
  • 方法概要

    修饰符和类型
    方法
    说明
    com.iohao.game.action.skeleton.core.flow.FlowContext
    get FlowContext
    com.iohao.game.common.kit.attr.AttrOptions
    获取动态成员属性
    default <T extends Player>
    T
    get 当前操作的玩家
    <T extends Room>
    T
    get room
    default long
    get roomId
    default long
    get userId
    of(Room room)
    创建 GameFlowContext(框架内置的默认实现)
    of(Room room, long userId)
    创建 GameFlowContext(框架内置的默认实现)
    of(Room room, com.iohao.game.action.skeleton.core.flow.FlowContext flowContext)
    创建 GameFlowContext(框架内置的默认实现)
    default <T> T
    option(com.iohao.game.common.kit.attr.AttrOption<T> option)
    get 动态属性,获取选项值,如果选项不存在,返回默认值。
    default <T> GameFlowContext
    option(com.iohao.game.common.kit.attr.AttrOption<T> option, T value)
    设置动态属性。
  • 方法详细资料

    • getOptions

      com.iohao.game.common.kit.attr.AttrOptions getOptions()
      获取动态成员属性
      返回:
      动态成员属性
    • getRoom

      <T extends Room> T getRoom()
      get room
      类型参数:
      T - t
      返回:
      room
    • getFlowContext

      com.iohao.game.action.skeleton.core.flow.FlowContext getFlowContext()
      get FlowContext
      返回:
      FlowContext
    • getPlayer

      default <T extends Player> T getPlayer()
      get 当前操作的玩家
      类型参数:
      T - t
      返回:
      当前玩家
    • getUserId

      default long getUserId()
      get userId
      返回:
      userId
    • getRoomId

      default long getRoomId()
      get roomId
      返回:
      roomId
    • option

      default <T> T option(com.iohao.game.common.kit.attr.AttrOption<T> option)
      get 动态属性,获取选项值,如果选项不存在,返回默认值。
      参数:
      option - 选项值
      返回:
      如果 option 不存在,则使用默认的 option 值。
    • option

      default <T> GameFlowContext option(com.iohao.game.common.kit.attr.AttrOption<T> option, T value)
      设置动态属性。设置一个具有特定值的新选项,使用 null 值删除前一个设置的 AttrOption。
      参数:
      option - 选项值
      value - 选项值, null 用于删除前一个 AttrOption.
      返回:
      this
    • of

      static GameFlowContext of(Room room, com.iohao.game.action.skeleton.core.flow.FlowContext flowContext)
      创建 GameFlowContext(框架内置的默认实现)
      参数:
      room - 房间
      flowContext - flowContext 当前玩家
      返回:
      GameFlowContext
    • of

      static GameFlowContext of(Room room)
      创建 GameFlowContext(框架内置的默认实现)
      参数:
      room - 房间
      返回:
      GameFlowContext
    • of

      static GameFlowContext of(Room room, long userId)
      创建 GameFlowContext(框架内置的默认实现)
      参数:
      room - 房间
      userId - userId
      返回:
      GameFlowContext