### robocode

# Class BattleEndedEvent

- `java.lang.Object`
- - `robocode.Event`
  - - `robocode.BattleEndedEvent`

Implemented Interfaces:
  Comparable, Serializable

`public final class BattleEndedEvent`
`extends Event`

A BattleEndedEvent is sent to `onBattleEnded()` when the battle is ended. You can use the information contained in this event to determine if the battle was aborted and also get the results of the battle.

Author:
  Pavel Savara (original)

Since:
  1.6.1

See Also:
  `BattleResults`, `Robot.onBattleEnded(BattleEndedEvent)`

  ## Constructor Summary

  `BattleEndedEvent(boolean aborted, BattleResults results)`
    Called by the game to create a new BattleEndedEvent.

  ## Method Summary

  `BattleResults`

  `getResults()`
    Returns the battle results.

  `@Override`

  `int getPriority()`

  `boolean`

  `isAborted()`
    Checks if this battle was aborted.

  ### Methods inherited from class robocode.Event

  `compareTo`, `getPriority`, `getTime`

## Constructor Details

### BattleEndedEvent

    public BattleEndedEvent(boolean aborted,
                            BattleResults results)

> Called by the game to create a new BattleEndedEvent.
> Parameters:
>   `aborted` - `true` if the battle was aborted; `false` otherwise.
>   `results` - the battle results

## Method Details

### getResults

    public BattleResults getResults()

> Returns the battle results.
> Returns:
>   the battle results.

### int getPriority

    public final @Override int getPriority()

### isAborted

    public boolean isAborted()

> Checks if this battle was aborted.
> Returns:
>   `true` if the battle was aborted; `false` otherwise.