Package robocode.control.events
Class BattleCompletedEvent
java.lang.Object
robocode.control.events.BattleEvent
robocode.control.events.BattleCompletedEvent
A BattleCompletedEvent is sent to
onBattleCompleted()
when the battle is 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.- Since:
- 1.6.2
- Author:
- Pavel Savara (original), Flemming N. Larsen (contributor)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBattleCompletedEvent
(BattleRules battleRules, BattleResults[] results) Called by the game to create a new BattleCompletedEvent. -
Method Summary
Modifier and TypeMethodDescriptionReturns the rules used in the battle.Returns the battle results that can be used to determine the score for the individual robot based on the robot index.Returns the battle results sorted on score.
-
Constructor Details
-
BattleCompletedEvent
Called by the game to create a new BattleCompletedEvent. Please don't use this constructor as it might change.- Parameters:
battleRules
- the rules that was used in the battle.results
- the indexed results of the battle. These are unsorted, but using robot indexes.
-
-
Method Details
-
getBattleRules
Returns the rules used in the battle.- Returns:
- the rules used in the battle.
-
getSortedResults
Returns the battle results sorted on score. Note that the robot index cannot be used to determine the score with the sorted results.- Returns:
- an array of sorted BattleResults, where the results with the bigger score are placed first in the list.
- See Also:
-
getIndexedResults
Returns the battle results that can be used to determine the score for the individual robot based on the robot index.- Returns:
- an array of indexed BattleResults, where each index matches an index of a specific robot.
- See Also:
-