robocode.naval.interfaces
Interface IComponent

All Known Implementing Classes:
ComponentBase, MineComponent, RadarComponent, WeaponComponent

public interface IComponent

Interface that defines methods required by components.

Since:
1.8.3.0 Alpha 1
Version:
0.1
Author:
Thales B.V. / Jiri Waning

Method Summary
 double getAngle()
          Get the angle of the component; in radians.
 double getAngleDegrees()
          Get the angle of the component; in degrees.
 Color getColor()
          Get the color of the component.
 double getGunHeat()
           
 double getLastAngle()
           
 Point2D getOrigin(ITransformable peer)
          Get the exact location of the component.
 Point2D getPivot()
          Get the pivot point of the component as a Point2D object.
 byte getSerializeType()
           
 ComponentType getType()
          Get the type of the component.
 void setAngle(double angle)
          Set the angle of the component; in radians.
 void setAngleDegrees(double angle)
          Set the angle of the component; in degrees.
 void setColor(Color color)
          Set the color of the component.
 void setLastAngle(double lastHeading)
          Sets the lastHeading of the component in Radians.
 double turnRadians(double turnRemaining)
          Attempts to turn the component.
 

Method Detail

getType

ComponentType getType()
Get the type of the component.

The types differ for each class and classes may have multiple types!

Returns:
The type of the component.

getPivot

Point2D getPivot()
Get the pivot point of the component as a Point2D object.

The point is relative to that of the ship.

Returns:
The pivot point of the component.

getOrigin

Point2D getOrigin(ITransformable peer)
Get the exact location of the component. (On battlefield coordinates!)

Parameters:
peer - The robot the component belongs to.
Returns:
The exact location of the component.

getAngle

double getAngle()
Get the angle of the component; in radians.

Returns:
The angle of the component; in radians.

getAngleDegrees

double getAngleDegrees()
Get the angle of the component; in degrees.

Returns:
The angle of the component; in degrees.

setAngle

void setAngle(double angle)
Set the angle of the component; in radians.

Parameters:
angle - The angle to which to set the component.

setAngleDegrees

void setAngleDegrees(double angle)
Set the angle of the component; in degrees.

Parameters:
angle - The angle to which to set the component.

turnRadians

double turnRadians(double turnRemaining)
Attempts to turn the component.

Parameters:
turnRemaining - The angle in RADIANS the component still has to turn.
Returns:
The turnRemaining after the turning has been done.

setLastAngle

void setLastAngle(double lastHeading)
Sets the lastHeading of the component in Radians. This function is for example used to determine how large the Arc of the Radar has to be.

Parameters:
lastHeading - The lastHeading in Radians.

getLastAngle

double getLastAngle()

getColor

Color getColor()
Get the color of the component.

Returns:
The color of the component.

setColor

void setColor(Color color)
Set the color of the component.

Parameters:
color - The color of the component.

getGunHeat

double getGunHeat()

getSerializeType

byte getSerializeType()


Copyright © 2015 Robocode. All Rights Reserved.