Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
robocode.RobotStatus
StatusEvent.getStatus()
.
Constructor Summary | |
|
Method Summary | |
double |
|
double |
|
double |
|
double |
|
double |
|
double |
|
double |
|
double |
|
double |
|
int |
|
int |
|
double |
|
double |
|
double |
|
double |
|
int |
|
long |
|
double |
|
double |
|
double |
|
double |
|
double |
|
public RobotStatus(robocode.peer.RobotPeer robotPeer, robocode.peer.ExecCommands commands, robocode.battle.Battle battle)
Creates a new RobotStatus based a a RobotPeer. This constructor is called internally from the game.
- Parameters:
robotPeer
- the RobotPeer containing the states we must make a snapshot ofcommands
- data from commandsbattle
- data from battle
public double getDistanceRemaining()
Returns the distance remaining in the robot's current move measured in pixels. This call returns both positive and negative values. Positive values means that the robot is currently moving forwards. Negative values means that the robot is currently moving backwards.
- Returns:
- the distance remaining in the robot's current move measured in pixels.
public double getEnergy()
Returns the robot's current energy.
- Returns:
- the robot's current energy
public double getGunHeading()
Returns the direction that the robot's gun is facing, in degrees. The value returned will be between 0 and 360 (is excluded). Note that the heading in Robocode is like a compass, where 0 means North, 90 means East, 180 means South, and 270 means West.
- Returns:
- the direction that the robot's gun is facing, in degrees.
public double getGunHeadingRadians()
Returns the direction that the robot's gun is facing, in radians. The value returned will be between 0 and 2 * PI (is excluded). Note that the heading in Robocode is like a compass, where 0 means North, PI / 2 means East, PI means South, and 3 * PI / 4 means West.
- Returns:
- the direction that the robot's gun is facing, in radians.
public double getGunHeat()
Returns the current heat of the gun. The gun cannot fire unless this is 0. (Calls to fire will succeed, but will not actually fire unless getGunHeat() == 0). The amount of gun heat generated when the gun is fired is 1 + (firePower / 5). Each turn the gun heat drops by the amount returned byRobot.getGunCoolingRate()
, which is a battle setup. Note that all guns are "hot" at the start of each round, where the gun heat is 3.
- Returns:
- the current gun heat
public double getGunTurnRemaining()
Returns the angle remaining in the gun's turn, in degrees. This call returns both positive and negative values. Positive values means that the gun is currently turning to the right. Negative values means that the gun is currently turning to the left.
- Returns:
- the angle remaining in the gun's turn, in degrees
public double getGunTurnRemainingRadians()
Returns the angle remaining in the gun's turn, in radians. This call returns both positive and negative values. Positive values means that the gun is currently turning to the right. Negative values means that the gun is currently turning to the left.
- Returns:
- the angle remaining in the gun's turn, in radians
public double getHeading()
Returns the direction that the robot's body is facing, in degrees. The value returned will be between 0 and 360 (is excluded). Note that the heading in Robocode is like a compass, where 0 means North, 90 means East, 180 means South, and 270 means West.
- Returns:
- the direction that the robot's body is facing, in degrees.
public double getHeadingRadians()
Returns the direction that the robot's body is facing, in radians. The value returned will be between 0 and 2 * PI (is excluded). Note that the heading in Robocode is like a compass, where 0 means North, PI / 2 means East, PI means South, and 3 * PI / 4 means West.
- Returns:
- the direction that the robot's body is facing, in radians.
public int getNumRounds()
Returns the number of rounds in the current battle.
- Returns:
- the number of rounds in the current battle
- Since:
- 1.6.2
- See Also:
getRoundNum()
public int getOthers()
Returns how many opponents that are left in the current round.
- Returns:
- how many opponents that are left in the current round.
- Since:
- 1.6.2
public double getRadarHeading()
Returns the direction that the robot's radar is facing, in degrees. The value returned will be between 0 and 360 (is excluded). Note that the heading in Robocode is like a compass, where 0 means North, 90 means East, 180 means South, and 270 means West.
- Returns:
- the direction that the robot's radar is facing, in degrees.
public double getRadarHeadingRadians()
Returns the direction that the robot's radar is facing, in radians. The value returned will be between 0 and 2 * PI (is excluded). Note that the heading in Robocode is like a compass, where 0 means North, PI / 2 means East, PI means South, and 3 * PI / 4 means West.
- Returns:
- the direction that the robot's radar is facing, in radians.
public double getRadarTurnRemaining()
Returns the angle remaining in the radar's turn, in degrees. This call returns both positive and negative values. Positive values means that the radar is currently turning to the right. Negative values means that the radar is currently turning to the left.
- Returns:
- the angle remaining in the radar's turn, in degrees
public double getRadarTurnRemainingRadians()
Returns the angle remaining in the radar's turn, in radians. This call returns both positive and negative values. Positive values means that the radar is currently turning to the right. Negative values means that the radar is currently turning to the left.
- Returns:
- the angle remaining in the radar's turn, in radians
public int getRoundNum()
Returns the current round number (0 togetNumRounds()
- 1) of the battle.
- Returns:
- the current round number of the battle
- Since:
- 1.6.2
- See Also:
getNumRounds()
public long getTime()
Returns the game time of the round, where the time is equal to the current turn in the round.
- Returns:
- the game time/turn of the current round.
- Since:
- 1.6.2
public double getTurnRemaining()
Returns the angle remaining in the robots's turn, in degrees. This call returns both positive and negative values. Positive values means that the robot is currently turning to the right. Negative values means that the robot is currently turning to the left.
- Returns:
- the angle remaining in the robots's turn, in degrees
public double getTurnRemainingRadians()
Returns the angle remaining in the robots's turn, in radians. This call returns both positive and negative values. Positive values means that the robot is currently turning to the right. Negative values means that the robot is currently turning to the left.
- Returns:
- the angle remaining in the robots's turn, in radians
public double getVelocity()
Returns the velocity of the robot measured in pixels/turn. The maximum velocity of a robot is defined byRules.MAX_VELOCITY
(8 pixels / turn).
- Returns:
- the velocity of the robot measured in pixels/turn
- See Also:
Rules.MAX_VELOCITY
public double getX()
Returns the X position of the robot. (0,0) is at the bottom left of the battlefield.
- Returns:
- the X position of the robot
- See Also:
getY()
public double getY()
Returns the Y position of the robot. (0,0) is at the bottom left of the battlefield.
- Returns:
- the Y position of the robot
- See Also:
getX()