|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrobocode.Event
robocode.ScannedShipEvent
public class ScannedShipEvent
Extension on ScannedRobotEvent
Field Summary | |
---|---|
protected double |
distance
|
protected double |
energy
|
protected double |
heading
|
protected String |
name
|
protected double |
velocity
|
Constructor Summary | |
---|---|
ScannedShipEvent(String name,
double energy,
double bearingFront,
double bearingBack,
double bearingRadar,
double distance,
double heading,
double velocity)
Called by the game to create a new ScannedShipEvent. |
Method Summary | |
---|---|
int |
compareTo(Event event)
Compares this event to another event regarding precedence. |
double |
getBearingBack()
Returns the bearing to the robot you scanned, measured from the back weapon; relative to your robot's back weapon zero (absolute south!) |
double |
getBearingBackRadians()
Returns the bearing to the robot you scanned, measured from the back weapon; relative to your robot's back weapon zero (absolute south!) |
double |
getBearingDegrees()
|
double |
getBearingFront()
Returns the bearing to the ship you scanned, measured from the front weapon; relative to your ship's front weapon zero (absolute north!) |
double |
getBearingFrontRadians()
Returns the bearing to the robot you scanned, measured from the front weapon; relative to your robot's front weapon zero (absolute north!) |
double |
getBearingRadians()
|
double |
getDistance()
Returns the distance to the other ship's origin. |
double |
getEnergy()
Returns the energy of the ship. |
double |
getHeading()
Returns the heading of the ship, in degrees. (0 <= getHeading() < 360) |
double |
getHeadingRadians()
Returns the heading of the ship, in radians. (0 <= getHeading() < TWO_PI) |
String |
getName()
Returns the name of the ship. |
double |
getVelocity()
Returns the velocity of the ship. |
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 |
Field Detail |
---|
protected final String name
protected final double energy
protected final double heading
protected final double distance
protected final double velocity
Constructor Detail |
---|
public ScannedShipEvent(String name, double energy, double bearingFront, double bearingBack, double bearingRadar, double distance, double heading, double velocity)
name
- The name of the scanned ship.energy
- The energy of the scanned ship.bearingFront
- The bearing of the scanned ship, in radians, for the weapon on the front end.bearingBack
- The bearing of the scanned ship, in radians, for the weapon on the back end.bearingRadar
- The bearing of the scanned ship, in radians, for the radar.distance
- The distance from your ship to the scanned ship.heading
- The heading of the scanned ship.velocity
- The velocity of the scanned ship.Method Detail |
---|
public double getBearingFront()
public double getBearingFrontRadians()
public double getBearingBack()
public double getBearingBackRadians()
public double getDistance()
public double getEnergy()
public double getHeading()
public double getHeadingRadians()
public double getBearingRadians()
public double getBearingDegrees()
public String getName()
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 |