|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrobocode.Event
robocode.ScannedRobotEvent
public class ScannedRobotEvent
A ScannedRobotEvent is sent to onScannedRobot
when you scan a robot. You can use the information contained in this event to
determine what to do.
Constructor Summary | |
---|---|
ScannedRobotEvent(java.lang.String name,
double energy,
double bearing,
double distance,
double heading,
double velocity)
Called by the game to create a new ScannedRobotEvent. |
Method Summary | |
---|---|
double |
getBearing()
Returns the bearing to the robot you scanned, relative to your robot's heading, in degrees (-180 <= getBearing() < 180) |
double |
getBearingRadians()
Returns the bearing to the robot you scanned, relative to your robot's heading, in radians (-PI <= getBearingRadians() < PI) |
double |
getDistance()
Returns the distance to the robot (your center to his center). |
double |
getEnergy()
Returns the energy of the robot. |
double |
getHeading()
Returns the heading of the robot, in degrees (0 <= getHeading() < 360) |
double |
getHeadingRadians()
Returns the heading of the robot, in radians (0 <= getHeading() < 2 * PI) |
double |
getLife()
Deprecated. Use getEnergy() instead. |
java.lang.String |
getName()
Returns the name of the robot. |
double |
getRobotBearing()
Deprecated. Use getBearing() instead. |
double |
getRobotBearingDegrees()
Deprecated. Use getBearing() instead. |
double |
getRobotBearingRadians()
Deprecated. Use getBearingRadians() instead. |
double |
getRobotDistance()
Deprecated. Use getDistance() instead. |
double |
getRobotHeading()
Deprecated. Use getHeading() instead. |
double |
getRobotHeadingDegrees()
Deprecated. Use getHeading() instead. |
double |
getRobotHeadingRadians()
Deprecated. Use getHeadingRadians() instead. |
double |
getRobotLife()
Deprecated. Use getEnergy() instead. |
java.lang.String |
getRobotName()
Deprecated. Use getName() instead. |
double |
getRobotVelocity()
Deprecated. Use getVelocity() instead. |
double |
getVelocity()
Returns the velocity of the robot. |
Methods inherited from class robocode.Event |
---|
compareTo, getPriority, getTime, setPriority, setTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScannedRobotEvent(java.lang.String name, double energy, double bearing, double distance, double heading, double velocity)
name
- the name of the scanned robotenergy
- the energy of the scanned robotbearing
- the bearing of the scanned robot, in radiansdistance
- the distance from your robot to the scanned robotheading
- the heading of the scanned robotvelocity
- the velocity of the scanned robotMethod Detail |
---|
public double getBearing()
public double getBearingRadians()
public double getDistance()
public double getEnergy()
public double getHeading()
public double getHeadingRadians()
@Deprecated public double getLife()
getEnergy()
instead.
public java.lang.String getName()
@Deprecated public double getRobotBearing()
getBearing()
instead.
@Deprecated public double getRobotBearingDegrees()
getBearing()
instead.
@Deprecated public double getRobotBearingRadians()
getBearingRadians()
instead.
@Deprecated public double getRobotDistance()
getDistance()
instead.
@Deprecated public double getRobotHeading()
getHeading()
instead.
@Deprecated public double getRobotHeadingDegrees()
getHeading()
instead.
@Deprecated public double getRobotHeadingRadians()
getHeadingRadians()
instead.
@Deprecated public double getRobotLife()
getEnergy()
instead.
@Deprecated public java.lang.String getRobotName()
getName()
instead.
@Deprecated public double getRobotVelocity()
getVelocity()
instead.
public double getVelocity()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |