Package robocode

Class BattleResults

java.lang.Object
robocode.BattleResults
All Implemented Interfaces:
Serializable, Comparable<BattleResults>
Direct Known Subclasses:
RobotResults

public class BattleResults extends Object implements Serializable, Comparable<BattleResults>
Contains the battle results returned by BattleEndedEvent.getResults() when a battle has ended.
Since:
1.6.1
Author:
Pavel Savara (original), Flemming N. Larsen (contributor)
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected double
     
    protected double
     
    protected int
     
    protected double
     
    protected double
     
    protected double
     
    protected int
     
    protected double
     
    protected int
     
    protected static final long
     
    protected double
     
    protected String
     
    protected int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BattleResults(String teamLeaderName, int rank, double score, double survival, double lastSurvivorBonus, double bulletDamage, double bulletDamageBonus, double ramDamage, double ramDamageBonus, int firsts, int seconds, int thirds)
    Constructs this BattleResults object.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    boolean
     
    int
    Returns the bullet damage score of this robot in the battle.
    int
    Returns the bullet damage bonus of this robot in the battle.
    int
    Returns the number of rounds this robot placed first in the battle.
    int
    Returns the last survivor score of this robot in the battle.
    int
    Returns the ram damage score of this robot in the battle.
    int
    Returns the ram damage bonus of this robot in the battle.
    int
    Returns the rank of this robot in the battle results.
    int
    Returns the total score of this robot in the battle.
    int
    Returns the number of rounds this robot placed second in the battle.
    int
    Returns the survival score of this robot in the battle.
    Returns the name of the team leader in the team or the name of the robot if the robot is not participating in a team.
    int
    Returns the number of rounds this robot placed third in the battle.
    int
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serialVersionUID

      protected static final long serialVersionUID
      See Also:
    • teamLeaderName

      protected String teamLeaderName
    • rank

      protected int rank
    • score

      protected double score
    • survival

      protected double survival
    • lastSurvivorBonus

      protected double lastSurvivorBonus
    • bulletDamage

      protected double bulletDamage
    • bulletDamageBonus

      protected double bulletDamageBonus
    • ramDamage

      protected double ramDamage
    • ramDamageBonus

      protected double ramDamageBonus
    • firsts

      protected int firsts
    • seconds

      protected int seconds
    • thirds

      protected int thirds
  • Constructor Details

    • BattleResults

      public BattleResults(String teamLeaderName, int rank, double score, double survival, double lastSurvivorBonus, double bulletDamage, double bulletDamageBonus, double ramDamage, double ramDamageBonus, int firsts, int seconds, int thirds)
      Constructs this BattleResults object.
      Parameters:
      teamLeaderName - the name of the team leader.
      rank - the rank of the robot in the battle.
      score - the total score for the robot in the battle.
      survival - the survival score for the robot in the battle.
      lastSurvivorBonus - the last survivor bonus for the robot in the battle.
      bulletDamage - the bullet damage score for the robot in the battle.
      bulletDamageBonus - the bullet damage bonus for the robot in the battle.
      ramDamage - the ramming damage for the robot in the battle.
      ramDamageBonus - the ramming damage bonus for the robot in the battle.
      firsts - the number of rounds this robot placed first.
      seconds - the number of rounds this robot placed second.
      thirds - the number of rounds this robot placed third.
  • Method Details

    • getTeamLeaderName

      public String getTeamLeaderName()
      Returns the name of the team leader in the team or the name of the robot if the robot is not participating in a team.
      Returns:
      the name of the team leader in the team or the name of the robot.
    • getRank

      public int getRank()
      Returns the rank of this robot in the battle results.
      Returns:
      the rank of this robot in the battle results.
    • getScore

      public int getScore()
      Returns the total score of this robot in the battle.
      Returns:
      the total score of this robot in the battle.
    • getSurvival

      public int getSurvival()
      Returns the survival score of this robot in the battle.
      Returns:
      the survival score of this robot in the battle.
    • getLastSurvivorBonus

      public int getLastSurvivorBonus()
      Returns the last survivor score of this robot in the battle.
      Returns:
      the last survivor score of this robot in the battle.
    • getBulletDamage

      public int getBulletDamage()
      Returns the bullet damage score of this robot in the battle.
      Returns:
      the bullet damage score of this robot in the battle.
    • getBulletDamageBonus

      public int getBulletDamageBonus()
      Returns the bullet damage bonus of this robot in the battle.
      Returns:
      the bullet damage bonus of this robot in the battle.
    • getRamDamage

      public int getRamDamage()
      Returns the ram damage score of this robot in the battle.
      Returns:
      the ram damage score of this robot in the battle.
    • getRamDamageBonus

      public int getRamDamageBonus()
      Returns the ram damage bonus of this robot in the battle.
      Returns:
      the ram damage bonus of this robot in the battle.
    • getFirsts

      public int getFirsts()
      Returns the number of rounds this robot placed first in the battle.
      Returns:
      the number of rounds this robot placed first in the battle.
    • getSeconds

      public int getSeconds()
      Returns the number of rounds this robot placed second in the battle.
      Returns:
      the number of rounds this robot placed second in the battle.
    • getThirds

      public int getThirds()
      Returns the number of rounds this robot placed third in the battle.
      Returns:
      the number of rounds this robot placed third in the battle.
    • compareTo

      public int compareTo(BattleResults o)
      Specified by:
      compareTo in interface Comparable<BattleResults>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object