Class OperationContext
java.lang.Object
com.iohao.net.extension.room.operation.OperationContext
- All Implemented Interfaces:
DomainEventSource, Eo, Topic, PlayerOperationContext
Room gameplay operation execution context and domain-event payload.
- Since:
- 21.8
- Author:
- 渔民小镇
- date:
- 2022-03-31
-
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Executes the player's gameplay operation, including verification and processing.Specific gameplay data to be operated, usually customized by the developer based on game business logicThe FlowContext of the current operating playerGameplay operation business handlergetRoom()roomstatic OperationContextof(Room room, OperationHandler operationHandler) Creates an OperationContext objectsetCommand(Object command) Specific gameplay data to be operated, usually customized by the developer based on game business logicsetFlowContext(FlowContext flowContext) The FlowContext of the current operating playerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DomainEventSource
getSourceMethods inherited from interface PlayerOperationContext
getPlayer, getRoomId, getUserId
-
Method Details
-
execute
public void execute()Executes the player's gameplay operation, including verification and processing. -
of
Creates an OperationContext object- Parameters:
room- RoomoperationHandler- Gameplay operation business interface- Returns:
- OperationContext Gameplay operation context
-
getRoom
-
getOperationHandler
Gameplay operation business handler -
getCommand
Specific gameplay data to be operated, usually customized by the developer based on game business logic- Specified by:
getCommandin interfacePlayerOperationContext- Returns:
- operation data
-
getFlowContext
The FlowContext of the current operating player- Specified by:
getFlowContextin interfacePlayerOperationContext- Returns:
- FlowContext
-
setCommand
Specific gameplay data to be operated, usually customized by the developer based on game business logic- Returns:
this.
-
setFlowContext
The FlowContext of the current operating player- Returns:
this.
-