robocode.control
Class ShipResults

java.lang.Object
  extended by robocode.BattleResults
      extended by robocode.NavalBattleResults
          extended by robocode.control.ShipResults
All Implemented Interfaces:
Serializable, Comparable<BattleResults>, IResults

public class ShipResults
extends NavalBattleResults
implements IResults

Handles the results for a specific Ship

Author:
Thales B.V. / Thomas Hakkers
See Also:
Serialized Form

Field Summary
 
Fields inherited from class robocode.BattleResults
bulletDamage, bulletDamageBonus, firsts, lastSurvivorBonus, ramDamage, ramDamageBonus, rank, score, seconds, survival, teamLeaderName, thirds
 
Constructor Summary
ShipResults(RobotSpecification ship, NavalBattleResults results)
          Constructs new ShipResults based on a RobotSpecification and NavalBattleResults.
ShipResults(RobotSpecification ship, String teamLeaderName, int rank, double score, double survival, double lastSurvivorBonus, double bulletDamage, double bulletDamageBonus, double ramDamage, double ramDamageBonus, double mineDamage, double mineDamageBonus, int firsts, int seconds, int thirds)
          Constructs a new ShipResults.
 
Method Summary
static ShipResults[] convertResults(NavalBattleResults[] results)
          Converts an array of NavalBattleResults into an array of ShipResults.
 boolean equals(Object obj)
           
 RobotSpecification getRobot()
          Returns the ship these results are meant for.
 int hashCode()
           
 
Methods inherited from class robocode.NavalBattleResults
getMineDamage, getMineDamageBonus
 
Methods inherited from class robocode.BattleResults
compareTo, getBulletDamage, getBulletDamageBonus, getFirsts, getLastSurvivorBonus, getRamDamage, getRamDamageBonus, getRank, getScore, getSeconds, getSurvival, getTeamLeaderName, getThirds
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShipResults

public ShipResults(RobotSpecification ship,
                   String teamLeaderName,
                   int rank,
                   double score,
                   double survival,
                   double lastSurvivorBonus,
                   double bulletDamage,
                   double bulletDamageBonus,
                   double ramDamage,
                   double ramDamageBonus,
                   double mineDamage,
                   double mineDamageBonus,
                   int firsts,
                   int seconds,
                   int thirds)
Constructs a new ShipResults.

Parameters:
ship - is the ship these results are for
teamLeaderName - is the team name
rank - is the rank of the ship in the battle
score - is the total score for the ship in the battle
survival - is the survival score for the ship in the battle
lastSurvivorBonus - is the last survivor bonus for the ship in the battle
bulletDamage - is the bullet damage score for the ship in the battle
bulletDamageBonus - is the bullet damage bonus for the ship in the battle
ramDamage - is the ramming damage for the ship in the battle
ramDamageBonus - is the ramming damage bonus for the ship in the battle
mineDamage - is the damage the mines of this ship have done in this battle
mineDamageBonus - is the mine bonus for the ship
firsts - is the number of rounds this ship placed first
seconds - is the number of rounds this ship placed second
thirds - is the number of rounds this ship placed third

ShipResults

public ShipResults(RobotSpecification ship,
                   NavalBattleResults results)
Constructs new ShipResults based on a RobotSpecification and NavalBattleResults.

Parameters:
ship - the ship these results are for
results - the battle results for the ship
Method Detail

getRobot

public RobotSpecification getRobot()
Returns the ship these results are meant for. Note that ships use RobotSpecifications, just like robots.

Specified by:
getRobot in interface IResults
Returns:
the ship these results are meant for.

convertResults

public static ShipResults[] convertResults(NavalBattleResults[] results)
Converts an array of NavalBattleResults into an array of ShipResults.

Parameters:
results - an array of NavalBattleResults to convert.
Returns:
an array of ShipResults converted from NavalBattleResults.
Since:
1.9.1.2

hashCode

public int hashCode()
Specified by:
hashCode in interface IResults
Overrides:
hashCode in class BattleResults

equals

public boolean equals(Object obj)
Specified by:
equals in interface IResults
Overrides:
equals in class BattleResults


Copyright © 2015 Robocode. All Rights Reserved.