接口 OperationHandler
- 所有已知实现类:
SimpleOperationHandler
public interface OperationHandler
玩法操作业务接口,将验证与操作分离。
坦克:
射子弹、发射导弹 等操作
麻将:
出牌、碰牌、胡牌等操作
斗地主:
出牌等操作
回合制的:
攻击等
桌游:
发牌等
出牌等
- 从以下版本开始:
- 21.8
- 作者:
- 渔民小镇
- 日期:
- 2022-03-31
-
方法概要
修饰符和类型方法说明voidprocess(PlayerOperationContext context) 验证通过后, 执行处理default booleanprocessVerify(PlayerOperationContext context) 检测验证,验证用户操作步骤是否合法,通过返回值来决定是否执行process(PlayerOperationContext)方法。default voidverify(PlayerOperationContext context) 已过时。
-
方法详细资料
-
verify
检测验证, 验证用户操作步骤是否合法- 参数:
context- 操作上下文
-
processVerify
检测验证,验证用户操作步骤是否合法,通过返回值来决定是否执行process(PlayerOperationContext)方法。当返回 false 时,不会执行 process 方法,相当于丢弃该请求的处理。 该方法与
verify(PlayerOperationContext)类似, 只不过多了一个返回值来决定是否执行 process 方法。- 参数:
context- 操作上下文- 返回:
- 当返回 true 时,会执行
process(PlayerOperationContext)方法 - 从以下版本开始:
- 21.23
-
process
验证通过后, 执行处理- 参数:
context- 操作上下文
-
processVerify(PlayerOperationContext)