Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## robocode.control.events
Interface IBattleListener

All Known Implementing Classes:
  BattleAdaptor

    public interface IBattleListener

The listener interface for receiving "interesting" battle events from the game, e.g. when a battle, round or turn is started or ended.

When implementing this battle listener you should implement the `BattleAdaptor` in order to only implement the event handler methods you are interested in.

Since:
  1.6.2
Author:
  Flemming N. Larsen (original)
See Also:
  `BattleAdaptor`

Method Summary
`void` | `onBattleCompleted(BattleCompletedEvent event)` 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` | `onBattleFinished(BattleFinishedEvent event)` This method is called when the battle has finished.
`void` | `onBattleMessage(BattleMessageEvent event)` 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` | `onBattleResumed(BattleResumedEvent event)` This method is called when the battle has been resumed (after having been paused).
`void` | `onBattleStarted(BattleStartedEvent event)` 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.

Method Detail

### onBattleStarted

    void onBattleStarted(BattleStartedEvent event)

  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.

  Parameters:
    `event` - the event details.
  See Also:
    `BattleStartedEvent`, `IBattleListener.onBattleCompleted(BattleCompletedEvent)`, `IBattleListener.onBattleFinished(BattleFinishedEvent)`

### onBattleFinished

    void onBattleFinished(BattleFinishedEvent event)

  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.

  Parameters:
    `event` - the event details.
  See Also:
    `BattleFinishedEvent`, `IBattleListener.onBattleStarted(BattleStartedEvent)`, `IBattleListener.onBattleCompleted(BattleCompletedEvent)`

### onBattleCompleted

    void onBattleCompleted(BattleCompletedEvent event)

  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.

  Parameters:
    `event` - the event details.
  See Also:
    `BattleCompletedEvent`, `IBattleListener.onBattleStarted(BattleStartedEvent)`, `IBattleListener.onBattleFinished(BattleFinishedEvent)`

### onBattlePaused

    void onBattlePaused(BattlePausedEvent event)

  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.

  Parameters:
    `event` - the event details.
  See Also:
    `BattlePausedEvent`, `IBattleListener.onBattleResumed(BattleResumedEvent)`

### onBattleResumed

    void onBattleResumed(BattleResumedEvent event)

  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.

  Parameters:
    `event` - the event details.
  See Also:
    `BattleResumedEvent`, `IBattleListener.onBattlePaused(BattlePausedEvent)`

### onRoundStarted

    void onRoundStarted(RoundStartedEvent event)

  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.

  Parameters:
    `event` - the event details.
  See Also:
    `RoundEndedEvent`, `IBattleListener.onRoundEnded(RoundEndedEvent)`

### onRoundEnded

    void onRoundEnded(RoundEndedEvent event)

  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.

  Parameters:
    `event` - the event details.
  See Also:
    `RoundEndedEvent`, `IBattleListener.onRoundStarted(RoundStartedEvent)`

### onTurnStarted

    void onTurnStarted(TurnStartedEvent event)

  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.

  Parameters:
    `event` - the event details.
  See Also:
    `TurnStartedEvent`, `IBattleListener.onTurnEnded(TurnEndedEvent)`

### onTurnEnded

    void onTurnEnded(TurnEndedEvent event)

  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.

  Parameters:
    `event` - the event details.
  See Also:
    `TurnEndedEvent`, `IBattleListener.onTurnStarted(TurnStartedEvent)`

### onBattleMessage

    void onBattleMessage(BattleMessageEvent event)

  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.

  Parameters:
    `event` - the event details.
  See Also:
    `BattleMessageEvent`, `IBattleListener.onBattleError(BattleErrorEvent)`

### onBattleError

    void onBattleError(BattleErrorEvent event)

  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.

  Parameters:
    `event` - the event details.
  See Also:
    `BattleErrorEvent`, `IBattleListener.onBattleMessage(BattleMessageEvent)`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 Robocode. All Rights Reserved.