Class BattleCompletedEvent

    • Constructor Detail

      • BattleCompletedEvent

        public BattleCompletedEvent​(BattleRules battleRules,
                                    BattleResults[] results)
        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 Detail

      • getBattleRules

        public BattleRules getBattleRules()
        Returns the rules used in the battle.
        Returns:
        the rules used in the battle.
      • 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.
        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 robot based on the robot index.
        Returns:
        an array of indexed BattleResults, where each index matches an index of a specific robot.
        See Also:
        getSortedResults()