### robocode.control.events

# Class BattleAdaptor

- `java.lang.Object`
- - `robocode.control.events.BattleAdaptor`

Implemented Interfaces:
  IBattleListener

`public abstract class BattleAdaptor`
`extends Object`
`implements IBattleListener`

An abstract adapter class for receiving battle events by implementing the `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);
           }
       }

Author:
  Flemming N. Larsen (original)

Since:
  1.6.2

See Also:
  `IBattleListener`

  ## Constructor Summary

  `BattleAdaptor()`
    Creates a BattleAdaptor.

  ## Method Summary

  `void`

  `onBattleCompleted(BattleCompletedEvent event)`

  `void`

  `onBattleError(BattleErrorEvent event)`

  `void`

  `onBattleFinished(BattleFinishedEvent event)`

  `void`

  `onBattleMessage(BattleMessageEvent event)`

  `void`

  `onBattlePaused(BattlePausedEvent event)`

  `void`

  `onBattleResumed(BattleResumedEvent event)`

  `void`

  `onBattleStarted(BattleStartedEvent event)`

  `void`

  `onRoundEnded(RoundEndedEvent event)`

  `void`

  `onRoundStarted(RoundStartedEvent event)`

  `void`

  `onTurnEnded(TurnEndedEvent event)`

  `void`

  `onTurnStarted(TurnStartedEvent event)`

## Constructor Details

### BattleAdaptor

    public BattleAdaptor()

> Creates a BattleAdaptor.

## Method Details

### onBattleCompleted

    public void onBattleCompleted(BattleCompletedEvent event)

> Specified by:
>   onBattleCompleted in interface IBattleListener

### onBattleError

    public void onBattleError(BattleErrorEvent event)

> Specified by:
>   onBattleError in interface IBattleListener

### onBattleFinished

    public void onBattleFinished(BattleFinishedEvent event)

> Specified by:
>   onBattleFinished in interface IBattleListener

### onBattleMessage

    public void onBattleMessage(BattleMessageEvent event)

> Specified by:
>   onBattleMessage in interface IBattleListener

### onBattlePaused

    public void onBattlePaused(BattlePausedEvent event)

> Specified by:
>   onBattlePaused in interface IBattleListener

### onBattleResumed

    public void onBattleResumed(BattleResumedEvent event)

> Specified by:
>   onBattleResumed in interface IBattleListener

### onBattleStarted

    public void onBattleStarted(BattleStartedEvent event)

> Specified by:
>   onBattleStarted in interface IBattleListener

### onRoundEnded

    public void onRoundEnded(RoundEndedEvent event)

> Specified by:
>   onRoundEnded in interface IBattleListener

### onRoundStarted

    public void onRoundStarted(RoundStartedEvent event)

> Specified by:
>   onRoundStarted in interface IBattleListener

### onTurnEnded

    public void onTurnEnded(TurnEndedEvent event)

> Specified by:
>   onTurnEnded in interface IBattleListener

### onTurnStarted

    public void onTurnStarted(TurnStartedEvent event)

> Specified by:
>   onTurnStarted in interface IBattleListener