|
|||||||||
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.
Note: You should not inherit from this class in your own event class! The internal logic of this event class might change. Hence, your robot might not work in future Robocode versions, if you choose to inherit from this class.
Constructor Summary | |
---|---|
ScannedRobotEvent()
Deprecated. Use ScannedRobotEvent(String, double, double, double, double, double) instead. |
|
ScannedRobotEvent(String name,
double energy,
double bearing,
double distance,
double heading,
double velocity)
Called by the game to create a new ScannedRobotEvent. |
Method Summary | |
---|---|
int |
compareTo(Event event)
Compares this event to another event regarding precedence. |
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. |
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. |
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 |
---|
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()
ScannedRobotEvent(String, double, double, double, double, double)
instead.
Note: You should not inherit from this class in your own event class! The internal logic of this event class might change. Hence, your robot might not work in future Robocode versions, if you choose to inherit from this class.
public ScannedRobotEvent(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 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 String getRobotName()
getName()
instead.
@Deprecated public double getRobotVelocity()
getVelocity()
instead.
public double getVelocity()
public final int compareTo(Event event)
compareTo
in interface Comparable<Event>
compareTo
in class Event
event
- the event to compare to this event.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |