public final class HitByBulletEvent extends Event
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 and Description |
---|
HitByBulletEvent(double bearing,
Bullet bullet)
Called by the game to create a new HitByBulletEvent.
|
Modifier and Type | Method and Description |
---|---|
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.
|
compareTo, getPriority, getTime, setPriority, setTime
public HitByBulletEvent(double bearing, Bullet bullet)
bearing
- the bearing of the bullet that hit your robot, in radiansbullet
- the bullet that has hit your robotpublic 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()
Copyright © 2017. All rights reserved.