Package megamek.server.sbf
Interface SBFActionHandler
- All Superinterfaces:
SBFGameManagerHelper
- All Known Implementing Classes:
AbstractSBFActionHandler,SBFStandardUnitAttackHandler
This interface is implemented by SBF's action handlers, typically attack handlers. As in TW, action handlers are
extensions to the GameManager that handle all aspects of an action including modifying the game object and sending
packets upon being called by the GameManager.
-
Method Summary
Methods inherited from interface megamek.server.sbf.SBFGameManagerHelper
addReport, game, gameManager, packetHelper, send, send
-
Method Details
-
cares
boolean cares()- Returns:
- True when this handler should be called at the present state of the SBFGame (e.g. the phase). In that
case,
handle()should be called.
-
handle
void handle()Handles the action, e.g. attack with everything that's necessary, such as adding a report and sending changes to the Clients. When the handler has finished handling the action and is no longer needed, it must callsetFinished()to mark itself as a candidate for removal. -
setFinished
void setFinished() -
isFinished
boolean isFinished()If it returns true, it must be removed from the list of active handlers (handling this action is finished entirely). If it returns false, it must remain.- Returns:
- False when this handler must remain active after doing its present handling, true otherwise
-
getAction
EntityAction getAction()- Returns:
- The EntityAction that this handler is executing.
-