robocode
Class RobotStatus
- Flemming N. Larsen (original)
RobotStatus(robocode.peer.RobotPeer robotPeer) - Creates a new RobotStatus based a a RobotPeer.
|
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.
|
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.
|
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.
|
double | getY() - Returns the Y position of the robot.
|
RobotStatus
public RobotStatus(robocode.peer.RobotPeer robotPeer)
Creates a new RobotStatus based a a RobotPeer.
This constructor is called internally from the game.
robotPeer
- the RobotPeer containing the states we must make a snapshot of
getDistanceRemaining
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.
- the distance remaining in the robot's current move measured in
pixels.
getEnergy
public double getEnergy()
Returns the robot's current energy.
- the robot's current energy
getGunHeading
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.
- the direction that the robot's gun is facing, in degrees.
getGunHeadingRadians
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.
- the direction that the robot's gun is facing, in radians.
getGunHeat
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
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.
getGunTurnRemaining
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.
- the angle remaining in the gun's turn, in degrees
getGunTurnRemainingRadians
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.
- the angle remaining in the gun's turn, in radians
getHeading
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.
- the direction that the robot's body is facing, in degrees.
getHeadingRadians
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.
- the direction that the robot's body is facing, in radians.
getRadarHeading
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.
- the direction that the robot's radar is facing, in degrees.
getRadarHeadingRadians
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.
- the direction that the robot's radar is facing, in radians.
getRadarTurnRemaining
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.
- the angle remaining in the radar's turn, in degrees
getRadarTurnRemainingRadians
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.
- the angle remaining in the radar's turn, in radians
getTurnRemaining
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.
- the angle remaining in the robots's turn, in degrees
getTurnRemainingRadians
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.
- the angle remaining in the robots's turn, in radians
getVelocity
public double getVelocity()
Returns the velocity of the robot measured in pixels/turn.
The maximum velocity of a robot is defined by
Rules.MAX_VELOCITY
(8 pixels / turn).
- the velocity of the robot measured in pixels/turn
getX
public double getX()
Returns the X position of the robot. (0,0) is at the bottom left of the
battlefield.
- the X position of the robot
getY
public double getY()
Returns the Y position of the robot. (0,0) is at the bottom left of the
battlefield.
- the Y position of the robot