robocode.control.events
Class NavalBattleCompletedEvent
java.lang.Object
robocode.control.events.BattleEvent
robocode.control.events.BattleCompletedEvent
robocode.control.events.NavalBattleCompletedEvent
public class NavalBattleCompletedEvent
- extends BattleCompletedEvent
Contains the battle results returned by BattleEndedEvent.getResults()
when a battle has ended.
- Since:
- 1.9.1.2
- Author:
- Mathew A. Nelson (original), Flemming N. Larsen (contributor), Thales B.V. / Thomas Hakkers
- See Also:
NavalBattleEndedEvent#getResults()
,
Ship#onBattleEnded(BattleEndedEvent)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NavalBattleCompletedEvent
public NavalBattleCompletedEvent(BattleRules battleRules,
NavalBattleResults[] results)
getSortedResults
public BattleResults[] getSortedResults()
- Returns the battle results sorted on score.
Note that the robot index cannot be used to determine the score with the sorted results.
Overrides
BattleResults#getSortedResults()
and instead returns an array with NavalBattleResults.
- Overrides:
getSortedResults
in class BattleCompletedEvent
- Returns:
- an array of sorted BattleResults, where the results with the bigger score are placed first in the list.
- See Also:
getIndexedResults()
getIndexedResults
public BattleResults[] getIndexedResults()
- Returns the battle results that can be used to determine the score for the individual ship based
on the ship index.
Overrides
BattleResults#getIndexedResults()
and instead returns an array with NavalBattleResults.
- Overrides:
getIndexedResults
in class BattleCompletedEvent
- Returns:
- an array of indexed NavalBattleResults, where each index matches an index of a specific robot.
- See Also:
getSortedResults()
Copyright © 2015 Robocode. All Rights Reserved.