robocode.control.events
Class BattleCompletedEvent
public class 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.
- Pavel Savara (original)
- Flemming N. Larsen (contributor)
BattleCompletedEvent
public BattleCompletedEvent(BattleRules battleRules,
BattleResults[] results)
Creates a new BattleCompletedEvent.
battleRules
- the rules that was used in the battle.results
- the indexed results of the battle. These are unsorted, but using robot indexes.
getBattleRules
public BattleRules getBattleRules()
Returns the rules that was used in the battle.
getIndexedResults
public BattleResults[] getIndexedResults()
Returns the unsorted battle results so that robot indexes can be used.
- an unsorted array of BattleResults, where each index matches an index of a specific robot.
getSortedResults
public BattleResults[] getSortedResults()
Returns the battle results sorted on score, meaning that robot indexes cannot be used.
- a sorted array of BattleResults, where the results with the biggest score are placed first in the list.