robocode.control.events
Class NavalBattleCompletedEvent

java.lang.Object
  extended by robocode.control.events.BattleEvent
      extended by robocode.control.events.BattleCompletedEvent
          extended by 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)

Field Summary
 
Fields inherited from class robocode.control.events.BattleCompletedEvent
results
 
Constructor Summary
NavalBattleCompletedEvent(BattleRules battleRules, NavalBattleResults[] results)
           
 
Method Summary
 BattleResults[] getIndexedResults()
          Returns the battle results that can be used to determine the score for the individual ship based on the ship index.
 BattleResults[] getSortedResults()
          Returns the battle results sorted on score.
 
Methods inherited from class robocode.control.events.BattleCompletedEvent
getBattleRules
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NavalBattleCompletedEvent

public NavalBattleCompletedEvent(BattleRules battleRules,
                                 NavalBattleResults[] results)
Method Detail

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.