|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--robocode.Event | +--robocode.HitRobotEvent
A HitRobotEvent is sent to Robot.onHitRobot(robocode.HitRobotEvent)
when you collide with another robot
You can use the information contained in this event to determine what to do.
Constructor Summary | |
HitRobotEvent(String name,
double bearing,
double energy,
boolean atFault)
Called by the game to create a new HitRobotEvent. |
Method Summary | |
double |
getBearing()
Returns the angle to the robot you hit, relative to your robot's heading. |
double |
getBearingDegrees()
Deprecated. use getBearing |
double |
getBearingRadians()
Returns the angle to the robot you hit in radians, relative to your robot's heading. |
double |
getEnergy()
Returns the energy of the robot you hit |
String |
getName()
Returns the name of the robot you hit |
String |
getRobotName()
Deprecated. use getName |
boolean |
isMyFault()
If you were moving toward the robot you hit, isMyFault() will return true. |
Methods inherited from class robocode.Event |
compareTo, getPriority, getTime, setPriority, setTime |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HitRobotEvent(String name, double bearing, double energy, boolean atFault)
Method Detail |
public double getBearing()
public double getBearingDegrees()
public double getBearingRadians()
public double getEnergy()
public String getName()
public String getRobotName()
public boolean isMyFault()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |