Class BulletHitEvent
java.lang.Object
robocode.Event
robocode.BulletHitEvent
- All Implemented Interfaces:
Serializable, Comparable<Event>
This event is sent to
onBulletHit
when one of your bullets has hit another robot.- Author:
- Mathew A. Nelson (original), Flemming N. Larsen (contributor)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBulletHitEvent(String name, double energy, Bullet bullet) Called by the game to create a newBulletHitEvent. -
Method Summary
Modifier and TypeMethodDescriptionReturns the bullet of yours that hit the robot.doubleReturns the remaining energy of the robot your bullet has hit (after the damage done by your bullet).doublegetLife()Deprecated.getName()Returns the name of the robot your bullet hit.doubleDeprecated.UsegetEnergy()instead.Deprecated.UsegetName()instead.Methods inherited from class Event
compareTo, getPriority, getTime, setPriority, setTime
-
Constructor Details
-
BulletHitEvent
-
-
Method Details
-
getBullet
Returns the bullet of yours that hit the robot.- Returns:
- the bullet that hit the robot
-
getEnergy
public double getEnergy()Returns the remaining energy of the robot your bullet has hit (after the damage done by your bullet).- Returns:
- energy the remaining energy of the robot that your bullet has hit
-
getLife
Deprecated.UsegetEnergy()instead.- Returns:
- energy the remaining energy of the robot that your bullet has hit
-
getName
Returns the name of the robot your bullet hit.- Returns:
- the name of the robot your bullet hit.
-
getRobotLife
Deprecated.UsegetEnergy()instead.- Returns:
- energy the remaining energy of the robot that your bullet has hit
-
getRobotName
Deprecated.UsegetName()instead.- Returns:
- the name of the robot your bullet hit.
-
getEnergy()instead.