|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrobocode.Event
robocode.HitByBulletEvent
public final class HitByBulletEvent
A HitByBulletEvent is sent to onHitByBullet()
when your robot has been hit by a bullet.
You can use the information contained in this event to determine what to do.
Constructor Summary | |
---|---|
HitByBulletEvent(double bearing,
Bullet bullet)
Called by the game to create a new HitByBulletEvent. |
Method Summary | |
---|---|
double |
getBearing()
Returns the bearing to the bullet, relative to your robot's heading, in degrees (-180 < getBearing() <= 180). |
double |
getBearingRadians()
Returns the bearing to the bullet, relative to your robot's heading, in radians (-Math.PI < getBearingRadians() <= Math.PI). |
Bullet |
getBullet()
Returns the bullet that hit your robot. |
double |
getHeading()
Returns the heading of the bullet when it hit you, in degrees (0 <= getHeading() < 360). |
double |
getHeadingDegrees()
Deprecated. Use getHeading() instead. |
double |
getHeadingRadians()
Returns the heading of the bullet when it hit you, in radians (0 <= getHeadingRadians() < 2 * PI). |
String |
getName()
Returns the name of the robot that fired the bullet. |
double |
getPower()
Returns the power of this bullet. |
double |
getVelocity()
Returns the velocity of this bullet. |
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 HitByBulletEvent(double bearing, Bullet bullet)
bearing
- the bearing of the bullet that hit your robot, in radiansbullet
- the bullet that has hit your robotMethod Detail |
---|
public double getBearing()
public double getBearingRadians()
public Bullet getBullet()
public double getHeading()
@Deprecated public double getHeadingDegrees()
getHeading()
instead.
public double getHeadingRadians()
public String getName()
public double getPower()
public double getVelocity()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |