public final class ScannedRobotEvent extends Event
onScannedRobot() when you scan a robot.
You can use the information contained in this event to determine what to do.| Constructor and Description |
|---|
ScannedRobotEvent(String name,
double energy,
double bearing,
double distance,
double heading,
double velocity)
Called by the game to create a new ScannedRobotEvent.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
getPriority, getTimepublic 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 robotpublic 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 Eventevent - the event to compare to this event.