public class BattleCompletedEvent extends BattleEvent
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.IBattleListener
,
IBattleListener.onBattleCompleted(BattleCompletedEvent)
,
BattleStartedEvent
,
BattleFinishedEvent
Constructor and Description |
---|
BattleCompletedEvent(BattleRules battleRules,
BattleResults[] results)
Called by the game to create a new BattleCompletedEvent.
|
Modifier and Type | Method and Description |
---|---|
BattleRules |
getBattleRules()
Returns the rules used in the battle.
|
BattleResults[] |
getIndexedResults()
Returns the battle results that can be used to determine the score for the individual robot based
on the robot index.
|
BattleResults[] |
getSortedResults()
Returns the battle results sorted on score.
|
public BattleCompletedEvent(BattleRules battleRules, BattleResults[] results)
battleRules
- the rules that was used in the battle.results
- the indexed results of the battle. These are unsorted, but using robot indexes.public BattleRules getBattleRules()
public BattleResults[] getSortedResults()
getIndexedResults()
public BattleResults[] getIndexedResults()
getSortedResults()
Copyright © 2021 Robocode. All Rights Reserved.