Package robocode
Class BattleEndedEvent
- java.lang.Object
-
- robocode.Event
-
- robocode.BattleEndedEvent
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Event>
public final class BattleEndedEvent extends Event
A BattleEndedEvent is sent toonBattleEnded()
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.- Since:
- 1.6.1
- Author:
- Pavel Savara (original), Flemming N. Larsen (contributor)
- See Also:
BattleResults
,Robot.onBattleEnded(BattleEndedEvent)
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BattleEndedEvent(boolean aborted, BattleResults results)
Called by the game to create a new BattleEndedEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPriority()
Returns the priority of this event.BattleResults
getResults()
Returns the battle results.boolean
isAborted()
Checks if this battle was aborted.-
Methods inherited from class robocode.Event
compareTo, getTime, setPriority, setTime
-
-
-
-
Constructor Detail
-
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 Detail
-
isAborted
public boolean isAborted()
Checks if this battle was aborted.- Returns:
true
if the battle was aborted;false
otherwise.
-
getResults
public BattleResults getResults()
Returns the battle results.- Returns:
- the battle results.
-
getPriority
public final int getPriority()
Returns the priority of this event.An event priority is a value from 0 - 99. The higher value, the higher priority.
The default priority is 80, but varies depending on the type of event.
- Overrides:
getPriority
in classEvent
- Returns:
- the priority of this event.
-
-