robocode.naval
Class MineComponent

java.lang.Object
  extended by robocode.naval.ComponentBase
      extended by robocode.naval.MineComponent
All Implemented Interfaces:
Serializable, IComponent

public class MineComponent
extends ComponentBase

The class that represents the component on the Ship that drops a mine.

Author:
Thales B.V. / Thomas Hakkers
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class robocode.naval.ComponentBase
ComponentBase.HiddenComponentHelper
 
Field Summary
 
Fields inherited from class robocode.naval.ComponentBase
angle, lastHeading, type
 
Constructor Summary
MineComponent()
          A constructor that creates a default MineComponent
MineComponent(double x, double y, ComponentType type)
          The constructor for the MineComponent
MineComponent(Point2D pivot, ComponentType type)
          The constructor for the MineComponent
 
Method Summary
 double getMineRecharge()
          Basically the same as coolDown for weapons.
 byte getSerializeType()
           
 void rechargeMine(double coolingRate)
          Recharges your MineComponent.
 void setMineRecharge(double heat)
          Sets the recharge heat for the MineComponent.
 double turnRadians(double turnRemaining)
          Deprecated. 
 
Methods inherited from class robocode.naval.ComponentBase
equals, getAngle, getAngleDegrees, getColor, getGunHeat, getLastAngle, getOrigin, getPivot, getType, setAngle, setAngleDegrees, setColor, setLastAngle, setType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MineComponent

public MineComponent(double x,
                     double y,
                     ComponentType type)
The constructor for the MineComponent

Parameters:
x - The x value relative to the pivot of the ship
y - The y value relative to the pivot of the ship
type - The type of the component, see ComponentType

MineComponent

public MineComponent(Point2D pivot,
                     ComponentType type)
The constructor for the MineComponent

Parameters:
pivot - The x and y value of the component relative to the pivot of the ship.
type - The type of the component, see ComponentType

MineComponent

public MineComponent()
A constructor that creates a default MineComponent

Method Detail

setMineRecharge

public void setMineRecharge(double heat)
Sets the recharge heat for the MineComponent.

Parameters:
heat -
See Also:
MineComponent#rechargeMine(double coolingRate) rechargeMine()}

getMineRecharge

public double getMineRecharge()
Basically the same as coolDown for weapons. It's just that Mines tend to explode once they get hot

Returns:
The current "mine recharge". If it's 0, you can place a mine.

rechargeMine

public void rechargeMine(double coolingRate)
Recharges your MineComponent. Once the mineRecharge is back to 0, a mine can be placed again.

Parameters:
coolingRate - The rate at which the mine is being recharged.

turnRadians

@Deprecated
public double turnRadians(double turnRemaining)
Deprecated. 

Description copied from interface: IComponent
Attempts to turn the component.

Specified by:
turnRadians in interface IComponent
Specified by:
turnRadians in class ComponentBase
Parameters:
turnRemaining - The angle in RADIANS the component still has to turn.
Returns:
The turnRemaining after the turning has been done.

getSerializeType

public byte getSerializeType()
Specified by:
getSerializeType in interface IComponent
Overrides:
getSerializeType in class ComponentBase


Copyright © 2015 Robocode. All Rights Reserved.