Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## robocode
Class BulletHitEvent

    java.lang.Object
      robocode.Event
          robocode.BulletHitEvent

All Implemented Interfaces:
  Serializable, Comparable

    public final class BulletHitEvent

extends Event

This event is sent to `onBulletHit` when one of your bullets has hit another robot.

Author:
  Mathew A. Nelson (original)
See Also:
  Serialized Form

Constructor Summary
`BulletHitEvent(String name, double energy, Bullet bullet)` Called by the game to create a new `BulletHitEvent`.

Method Summary
`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. Use `BulletHitEvent.getEnergy()` instead.
`String` | `getName()` Returns the name of the robot your bullet hit.
`double` | `getRobotLife()` Deprecated. Use `BulletHitEvent.getEnergy()` instead.
`String` | `getRobotName()` Deprecated. Use `BulletHitEvent.getName()` instead.

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

### BulletHitEvent

    public BulletHitEvent(String name,
                          double energy,
                          Bullet bullet)

  Called by the game to create a new `BulletHitEvent`.

  Parameters:
    `name` - the name of the robot your bullet hit
    `energy` - the remaining energy of the robot that your bullet has hit
    `bullet` - 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. Use `BulletHitEvent.getEnergy()` instead.

  Returns:
    energy the remaining energy of the robot that your bullet has hit

### getName

    public 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. Use `BulletHitEvent.getEnergy()` instead.

  Returns:
    energy the remaining energy of the robot that your bullet has hit

### getRobotName

    @Deprecated
    public String getRobotName()

  Deprecated. Use `BulletHitEvent.getName()` instead.

  Returns:
    the name of the robot your bullet hit.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2010 Robocode. All Rights Reserved.