Package robocode
Class BulletHitEvent
- java.lang.Object
-
- robocode.Event
-
- robocode.BulletHitEvent
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<Event>
public final class BulletHitEvent extends Event
This event is sent toonBulletHit
when one of your bullets has hit another robot.- Author:
- Mathew A. Nelson (original), Flemming N. Larsen (contributor)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BulletHitEvent(java.lang.String name, double energy, Bullet bullet)
Called by the game to create a newBulletHitEvent
.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Bullet
getBullet()
Returns the bullet of yours that hit the robot.double
getEnergy()
Returns the remaining energy of the robot your bullet has hit (after the damage done by your bullet).double
getLife()
Deprecated.UsegetEnergy()
instead.java.lang.String
getName()
Returns the name of the robot your bullet hit.double
getRobotLife()
Deprecated.UsegetEnergy()
instead.java.lang.String
getRobotName()
Deprecated.UsegetName()
instead.-
Methods inherited from class robocode.Event
compareTo, getPriority, getTime, setPriority, setTime
-
-
-
-
Constructor Detail
-
BulletHitEvent
public BulletHitEvent(java.lang.String name, double energy, Bullet bullet)
Called by the game to create a newBulletHitEvent
.- Parameters:
name
- the name of the robot your bullet hitenergy
- the remaining energy of the robot that your bullet has hitbullet
- the bullet that hit the robot
-
-
Method Detail
-
getBullet
public Bullet 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 public double getLife()
Deprecated.UsegetEnergy()
instead.- Returns:
- energy the remaining energy of the robot that your bullet has hit
-
getName
public java.lang.String getName()
Returns the name of the robot your bullet hit.- Returns:
- the name of the robot your bullet hit.
-
getRobotLife
@Deprecated public double getRobotLife()
Deprecated.UsegetEnergy()
instead.- Returns:
- energy the remaining energy of the robot that your bullet has hit
-
getRobotName
@Deprecated public java.lang.String getRobotName()
Deprecated.UsegetName()
instead.- Returns:
- the name of the robot your bullet hit.
-
-