robocode.naval.interfaces
Interface IRadarFunctions

All Known Subinterfaces:
IShip, IShip
All Known Implementing Classes:
Ship

public interface IRadarFunctions

Author:
Thales B.V. / Thomas Hakkers Describes the functions a RadarComponent can use. Mostly made to cleanup IShip a bit, but also so that there will be more flexibility in the future.

Method Summary
 double getRadarHeadingDegrees()
          Retrieve the angle the radar is heading in degrees.
 double getRadarHeadingRadians()
          Retrieve the angle the radar is heading in radians.
 double getRadarTurnRemainingDegrees()
          Returns the amount the Radar still has to turn in degrees.
 double getRadarTurnRemainingRadians()
          Returns the amount the Radar still has to turn in radians.
 double getXRadar()
          Returns the current X-coordinate of the Radar
 double getYRadar()
          Returns the current Y-coordinate of the Radar
 void setRadarColor(Color color)
          Sets the color of the radar.
 void setScanColor(Color color)
          Sets the Color of your scan
 void setTurnRadarLeftDegrees(double angle)
          Set the angle the Radar needs to turn towards the left in degrees.
 void setTurnRadarLeftRadians(double angle)
          Set the angle the Radar needs to turn towards the Left in radians.
 void setTurnRadarRightDegrees(double angle)
          Set the angle the Radar needs to turn towards the right in degrees.
 void setTurnRadarRightRadians(double angle)
          Set the angle the Radar needs to turn towards the Left in radians.
 

Method Detail

setTurnRadarLeftDegrees

void setTurnRadarLeftDegrees(double angle)
Set the angle the Radar needs to turn towards the left in degrees. If the current angle is 50, and you call this function like setTurnRadarLeftDegrees(40), the angle will end up being 10. (Not instantaneously, of course)

Parameters:
angle - The angle you want to turn the radar towards the left in degrees.

setTurnRadarRightDegrees

void setTurnRadarRightDegrees(double angle)
Set the angle the Radar needs to turn towards the right in degrees. If the current angle is 50, and you call this function like setTurnRadarRightDegrees(40), the angle will end up being 90. (Not instantaneously, of course)

Parameters:
angle - The angle you want to turn the radar towards the right in degrees.

setTurnRadarLeftRadians

void setTurnRadarLeftRadians(double angle)
Set the angle the Radar needs to turn towards the Left in radians. If the current angle is PI, and you call this function like setTurnRadarLeftRadians(PI/2), the angle will end up being PI/2. (Not instantaneously, of course)

Parameters:
angle - The angle you want to turn the radar towards the left in radians.

setTurnRadarRightRadians

void setTurnRadarRightRadians(double angle)
Set the angle the Radar needs to turn towards the Left in radians. If the current angle is PI, and you call this function like setTurnRadarRightRadians(PI/2), the angle will end up being 3PI/2. (Not instantaneously, of course)

Parameters:
angle - The angle you want to turn the radar towards the right in radians.

getRadarHeadingRadians

double getRadarHeadingRadians()
Retrieve the angle the radar is heading in radians.

Returns:
The heading of the radar in radians, this is not relative to the ship.

getRadarHeadingDegrees

double getRadarHeadingDegrees()
Retrieve the angle the radar is heading in degrees.

Returns:
The heading of the radar in degrees, this is not relative to the ship.

getRadarTurnRemainingRadians

double getRadarTurnRemainingRadians()
Returns the amount the Radar still has to turn in radians.

Returns:
turnRemaining for Radar in radians.

getRadarTurnRemainingDegrees

double getRadarTurnRemainingDegrees()
Returns the amount the Radar still has to turn in degrees.

Returns:
turnRemaining for Front Cannon in degrees.

setRadarColor

void setRadarColor(Color color)
Sets the color of the radar. Use this to make your Ship look pretty. You can either use the preconfigured colors like: Color.MAGENTA or Color.BLUE Or you can make your own custom colors by providing a Color like new Color(20, 50, 80), where the 3 arguments stand for Red Green Blue. (All of them must be integers in between 0 and 255)

Parameters:
color - The color you want your radar to be.

getXRadar

double getXRadar()
Returns the current X-coordinate of the Radar

Returns:
the current X-coordinate of the Radar

getYRadar

double getYRadar()
Returns the current Y-coordinate of the Radar

Returns:
the current Y-coordinate of the Radar

setScanColor

void setScanColor(Color color)
Sets the Color of your scan

Parameters:
color - The color you want your scan to be.


Copyright © 2015 Robocode. All Rights Reserved.