类 SimpleRoom

java.lang.Object
com.iohao.game.widget.light.room.SimpleRoom
所有已实现的接口:
Room, Serializable

public class SimpleRoom extends Object implements Room
房间(内置实现)
从以下版本开始:
21.8
作者:
渔民小镇
另请参阅:
日期:
2022-03-31
  • 构造器详细资料

    • SimpleRoom

      public SimpleRoom()
  • 方法详细资料

    • setAggregationContext

      void setAggregationContext(CommunicationAggregationContext aggregationContext)
      设置通讯上下文
      
       // 方式一:通过 flowContext 得到通讯上下文
       CommunicationAggregationContext aggregationContext = flowContext.option(FlowAttr.aggregationContext);
       // 方式二:通过 BrokerClient 得到通讯上下文
       CommunicationAggregationContext aggregationContext = BrokerClientHelper.getBrokerClient().getCommunicationAggregationContext();
       
       
      参数:
      aggregationContext - 通讯上下文
    • getAggregationContext

      CommunicationAggregationContext getAggregationContext()
      get 通讯上下文
      返回:
      通讯上下文
    • ofRangeBroadcast

      default RangeBroadcaster ofRangeBroadcast(CommunicationAggregationContext aggregationContext)
      通过 CommunicationAggregationContext 创建一个 RangeBroadcast,默认会添加上当前房间内的所有玩家
      参数:
      aggregationContext - aggregationContext
      返回:
      RangeBroadcast 范围内的广播
    • ofEmptyRangeBroadcast

      default RangeBroadcaster ofEmptyRangeBroadcast(CommunicationAggregationContext aggregationContext)
      通过 CommunicationAggregationContext 创建一个 RangeBroadcast
      参数:
      aggregationContext - aggregationContext
      返回:
      RangeBroadcast 范围内的广播
    • ofRangeBroadcast

      default RangeBroadcaster ofRangeBroadcast()
      创建一个 RangeBroadcast,默认会添加上当前房间内的所有玩家
      返回:
      RangeBroadcast 范围内的广播
    • ofEmptyRangeBroadcast

      default RangeBroadcaster ofEmptyRangeBroadcast()
      创建一个 RangeBroadcast
      返回:
      RangeBroadcast 范围内的广播