robocode
Class HitByMineEvent

java.lang.Object
  extended by robocode.Event
      extended by robocode.HitByMineEvent
All Implemented Interfaces:
Serializable, Comparable<Event>

public class HitByMineEvent
extends Event

This event is sent to onHitByMine when you get hit by a mine (Which can be your own).

Author:
Thales B.V. / Thomas Hakkers (original) Figured I'd add you in the credits, since most of it is copied from HitByBulletEvent, Mathew A. Nelson (contributor), Flemming N. Larsen (contributor)
See Also:
Serialized Form

Constructor Summary
HitByMineEvent(Mine mine)
          Called by the game to create a new HitByBulletEvent.
 
Method Summary
 Mine getMine()
          Returns the mine that hit your ship.
 String getName()
          Returns the name of the ship that placed the mine.
 double getPower()
          Returns the power of this mine.
 
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

HitByMineEvent

public HitByMineEvent(Mine mine)
Called by the game to create a new HitByBulletEvent.

Parameters:
mine - the mine that has hit your ship
Method Detail

getMine

public Mine getMine()
Returns the mine that hit your ship.

Returns:
the mine that hit your ship

getName

public String getName()
Returns the name of the ship that placed the mine.

Returns:
the name of the ship that placed the mine

getPower

public double getPower()
Returns the power of this mine. The damage you take (in fact, already took) is 3 * power, plus 5 if power == 15. The robot that placed the mine receives 3 * power back.

Returns:
the power of the mine


Copyright © 2015 Robocode. All Rights Reserved.