Class BattleAdaptor
- All Implemented Interfaces:
IBattleListener
IBattleListener
.
The methods in this class are empty. This class exists as convenience for creating listener objects.
This is handy class to use when implementing the IBattleListener. It saves you from implementing empty handlers for battle events you are not interested in handling.
Example:
private class BattleObserver extends BattleAdaptor { boolean isReplay; public void onBattleStarted(BattleStartedEvent event) { isReplay = event.isReplay(); } public void onBattleCompleted(BattleCompletedEvent event) { if (!isReplay) { printResultsData(event); } }
- Since:
- 1.6.2
- Author:
- Flemming N. Larsen (original)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method is called when the battle has completed successfully and results are available.void
onBattleError
(BattleErrorEvent event) This method is called when the game has sent an error message.void
This method is called when the battle has finished.void
This method is called when the game has sent a new information message.void
onBattlePaused
(BattlePausedEvent event) This method is called when the battle has been paused, either by the user or the game.void
This method is called when the battle has been resumed (after having been paused).void
This method is called when a new battle has started.void
onRoundEnded
(RoundEndedEvent event) This method is called when the current round of a battle has ended.void
onRoundStarted
(RoundStartedEvent event) This method is called when a new round in a battle has started.void
onTurnEnded
(TurnEndedEvent event) This method is called when the current turn in a battle round is ended.void
onTurnStarted
(TurnStartedEvent event) This method is called when a new turn in a battle round has started.
-
Constructor Details
-
BattleAdaptor
public BattleAdaptor()Creates a BattleAdaptor.
-
-
Method Details
-
onBattleStarted
This method is called when a new battle has started.You must override this method in order to get informed about this event and receive the event details.
- Specified by:
onBattleStarted
in interfaceIBattleListener
- Parameters:
event
- the event details.- See Also:
-
onBattleFinished
This method is called when the battle has finished. This event is always sent as the last battle event, both when the battle is completed successfully, terminated due to an error, or aborted by the user. Hence, this events is well-suited for cleanup after the battle.You must override this method in order to get informed about this event and receive the event details.
- Specified by:
onBattleFinished
in interfaceIBattleListener
- Parameters:
event
- the event details.- See Also:
-
onBattleCompleted
This method is called when the battle has completed successfully and results are available. This event will not occur if the battle is terminated or aborted by the user before the battle is completed.You must override this method in order to get informed about this event and receive the event details.
- Specified by:
onBattleCompleted
in interfaceIBattleListener
- Parameters:
event
- the event details.- See Also:
-
onBattlePaused
This method is called when the battle has been paused, either by the user or the game.You must override this method in order to get informed about this event and receive the event details.
- Specified by:
onBattlePaused
in interfaceIBattleListener
- Parameters:
event
- the event details.- See Also:
-
onBattleResumed
This method is called when the battle has been resumed (after having been paused).You must override this method in order to get informed about this event and receive the event details.
- Specified by:
onBattleResumed
in interfaceIBattleListener
- Parameters:
event
- the event details.- See Also:
-
onRoundStarted
This method is called when a new round in a battle has started.You must override this method in order to get informed about this event and receive the event details.
- Specified by:
onRoundStarted
in interfaceIBattleListener
- Parameters:
event
- the event details.- See Also:
-
onRoundEnded
This method is called when the current round of a battle has ended.You must override this method in order to get informed about this event and receive the event details.
- Specified by:
onRoundEnded
in interfaceIBattleListener
- Parameters:
event
- the event details.- See Also:
-
onTurnStarted
This method is called when a new turn in a battle round has started.You must override this method in order to get informed about this event and receive the event details.
- Specified by:
onTurnStarted
in interfaceIBattleListener
- Parameters:
event
- the event details.- See Also:
-
onTurnEnded
This method is called when the current turn in a battle round is ended.You must override this method in order to get informed about this event and receive the event details.
- Specified by:
onTurnEnded
in interfaceIBattleListener
- Parameters:
event
- the event details.- See Also:
-
onBattleMessage
This method is called when the game has sent a new information message.You must override this method in order to get informed about this event and receive the event details.
- Specified by:
onBattleMessage
in interfaceIBattleListener
- Parameters:
event
- the event details.- See Also:
-
onBattleError
This method is called when the game has sent an error message.You must override this method in order to get informed about this event and receive the event details.
- Specified by:
onBattleError
in interfaceIBattleListener
- Parameters:
event
- the event details.- See Also:
-