Interface OperationHandler
- All Known Implementing Classes:
SimpleOperationHandler
public interface OperationHandler
Gameplay operation business interface, separating validation from operation.
Tank:
Operations like shooting bullets, launching missiles, etc.
Mahjong:
Operations like discarding tiles, Pong (melding triplets), Hu (winning hand), etc.
Dou Dizhu (Fight the Landlord):
Operations like playing cards, etc.
Turn-based games:
Attacking, etc.
Board games:
Dealing cards, etc.
Playing cards, etc.
- Since:
- 21.8
- Author:
- 渔民小镇
- date:
- 2022-03-31
-
Method Summary
Modifier and TypeMethodDescriptionvoidprocess(PlayerOperationContext context) Execute processing after verification passesdefault booleanprocessVerify(PlayerOperationContext context) Check and verify if the user's operation step is valid, and determine whether to execute theprocess(PlayerOperationContext)method based on the return value.
-
Method Details
-
processVerify
Check and verify if the user's operation step is valid, and determine whether to execute theprocess(PlayerOperationContext)method based on the return value.When false is returned, the process method will not be executed, which is equivalent to discarding the processing of the request. It just adds a return value to decide whether to execute the process method.
- Parameters:
context- Operation context- Returns:
- When true is returned, the
process(PlayerOperationContext)method will be executed - Since:
- 21.23
-
process
Execute processing after verification passes- Parameters:
context- Operation context
-