public final class RobotStatus extends Object implements Serializable
StatusEvent.getStatus()
.Modifier and Type | Method and Description |
---|---|
double |
getDistanceRemaining()
Returns the distance remaining in the robot's current move measured in
pixels.
|
double |
getEnergy()
Returns the robot's current energy.
|
double |
getGunHeading()
Returns the direction that the robot's gun is facing, in degrees.
|
double |
getGunHeadingRadians()
Returns the direction that the robot's gun is facing, in radians.
|
double |
getGunHeat()
Returns the current heat of the gun.
|
double |
getGunTurnRemaining()
Returns the angle remaining in the gun's turn, in degrees.
|
double |
getGunTurnRemainingRadians()
Returns the angle remaining in the gun's turn, in radians.
|
double |
getHeading()
Returns the direction that the robot's body is facing, in degrees.
|
double |
getHeadingRadians()
Returns the direction that the robot's body is facing, in radians.
|
int |
getNumRounds()
Returns the number of rounds in the current battle.
|
int |
getNumSentries()
Returns how many sentry robots that are left in the current round.
|
int |
getOthers()
Returns how many opponents that are left in the current round.
|
double |
getRadarHeading()
Returns the direction that the robot's radar is facing, in degrees.
|
double |
getRadarHeadingRadians()
Returns the direction that the robot's radar is facing, in radians.
|
double |
getRadarTurnRemaining()
Returns the angle remaining in the radar's turn, in degrees.
|
double |
getRadarTurnRemainingRadians()
Returns the angle remaining in the radar's turn, in radians.
|
int |
getRoundNum()
Returns the current round number (0 to
getNumRounds() - 1) of
the battle. |
long |
getTime()
Returns the game time of the round, where the time is equal to the current turn in the round.
|
double |
getTurnRemaining()
Returns the angle remaining in the robots's turn, in degrees.
|
double |
getTurnRemainingRadians()
Returns the angle remaining in the robots's turn, in radians.
|
double |
getVelocity()
Returns the velocity of the robot measured in pixels/turn.
|
double |
getX()
Returns the X position of the robot. (0,0) is at the bottom left of the
battlefield.
|
double |
getY()
Returns the Y position of the robot. (0,0) is at the bottom left of the
battlefield.
|
public double getEnergy()
public double getX()
getY()
public double getY()
getX()
public double getHeadingRadians()
Note that the heading in Robocode is like a compass, where 0 means North, PI / 2 means East, PI means South, and 3 * PI / 2 means West.
public double getHeading()
Note that the heading in Robocode is like a compass, where 0 means North, 90 means East, 180 means South, and 270 means West.
public double getGunHeadingRadians()
Note that the heading in Robocode is like a compass, where 0 means North, PI / 2 means East, PI means South, and 3 * PI / 2 means West.
public double getGunHeading()
Note that the heading in Robocode is like a compass, where 0 means North, 90 means East, 180 means South, and 270 means West.
public double getRadarHeadingRadians()
Note that the heading in Robocode is like a compass, where 0 means North, PI / 2 means East, PI means South, and 3 * PI / 2 means West.
public double getRadarHeading()
Note that the heading in Robocode is like a compass, where 0 means North, 90 means East, 180 means South, and 270 means West.
public double getVelocity()
The maximum velocity of a robot is defined by Rules.MAX_VELOCITY
(8 pixels / turn).
Rules.MAX_VELOCITY
public double getTurnRemainingRadians()
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.
public double getTurnRemaining()
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.
public double getRadarTurnRemainingRadians()
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.
public double getRadarTurnRemaining()
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.
public double getGunTurnRemainingRadians()
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.
public double getGunTurnRemaining()
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.
public double getDistanceRemaining()
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.
public double getGunHeat()
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
by Robot.getGunCoolingRate()
, which is a battle setup.
Note that all guns are "hot" at the start of each round, where the gun heat is 3.
Robot.getGunCoolingRate()
,
Robot.fire(double)
,
Robot.fireBullet(double)
public int getOthers()
getNumSentries()
public int getNumSentries()
getOthers()
public int getNumRounds()
getRoundNum()
public int getRoundNum()
getNumRounds()
- 1) of
the battle.getNumRounds()
public long getTime()
Copyright © 2021 Robocode. All Rights Reserved.