Class OperationContext

java.lang.Object
com.iohao.net.extension.room.operation.OperationContext
All Implemented Interfaces:
DomainEventSource, Eo, Topic, PlayerOperationContext

public class OperationContext extends Object implements PlayerOperationContext, Eo
Room gameplay operation execution context and domain-event payload.
Since:
21.8
Author:
渔民小镇
date:
2022-03-31
  • Method Details

    • execute

      public void execute()
      Executes the player's gameplay operation, including verification and processing.
    • of

      public static OperationContext of(Room room, OperationHandler operationHandler)
      Creates an OperationContext object
      Parameters:
      room - Room
      operationHandler - Gameplay operation business interface
      Returns:
      OperationContext Gameplay operation context
    • getRoom

      public Room getRoom()
      room
      Specified by:
      getRoom in interface PlayerOperationContext
      Returns:
      room
    • getOperationHandler

      public OperationHandler getOperationHandler()
      Gameplay operation business handler
    • getCommand

      public Object getCommand()
      Specific gameplay data to be operated, usually customized by the developer based on game business logic
      Specified by:
      getCommand in interface PlayerOperationContext
      Returns:
      operation data
    • getFlowContext

      public FlowContext getFlowContext()
      The FlowContext of the current operating player
      Specified by:
      getFlowContext in interface PlayerOperationContext
      Returns:
      FlowContext
    • setCommand

      public OperationContext setCommand(Object command)
      Specific gameplay data to be operated, usually customized by the developer based on game business logic
      Returns:
      this.
    • setFlowContext

      public OperationContext setFlowContext(FlowContext flowContext)
      The FlowContext of the current operating player
      Returns:
      this.