robocode.naval.interfaces
Interface IFrontCannonFunctions

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

public interface IFrontCannonFunctions

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

Method Summary
 void fireFrontCannon(double power)
          Fires the a bullet/missile from the front cannon with the given power
 BlindSpot getCopyOfBlindSpotFrontCannon()
          Returns a copy of the BlindSpot that the back cannon has.
 boolean getFrontCannonAtBlindSpot()
          Returns true when the blindSpot has been reached for the backCannon
 double getFrontCannonHeadingDegrees()
          Retrieve the angle the front cannon is heading in degrees.
 double getFrontCannonHeadingRadians()
          Retrieve the angle the front cannon is heading in radians.
 double getFrontCannonTurnRemainingDegrees()
          Returns the amount the Front Cannon still has to turn in degrees.
 double getFrontCannonTurnRemainingRadians()
          Returns the amount the Front Cannon still has to turn in radians.
 double getXFrontCannon()
          Returns the current X-coordinate of your front cannon
 double getYFrontCannon()
          Returns the current Y-coordinate of your front cannon
 void setBulletColorFront(Color color)
          Sets the Bullet Color for the Front Cannon
 void setFrontCannonColor(Color color)
          Sets the color of the front cannon.
 void setTurnFrontCannonLeftDegrees(double angle)
          Turns the front cannon towards the left by the amount given in degrees.
 void setTurnFrontCannonLeftRadians(double angle)
          Turns the front cannon towards the left by the amount given in radians.
 void setTurnFrontCannonRightDegrees(double angle)
          Turns the front cannon towards the right by the amount given in degrees.
 void setTurnFrontCannonRightRadians(double angle)
          Turns the front cannon towards the right by the amount given in radians.
 

Method Detail

setTurnFrontCannonLeftDegrees

void setTurnFrontCannonLeftDegrees(double angle)
Turns the front cannon towards the left by the amount given in degrees. The cannon will be stopped when it reaches its blindspot. TurnRemaining won't go to 0 when this happens.

Parameters:
angle - The angle in degrees you want to rotate your front cannon to the left.

setTurnFrontCannonRightDegrees

void setTurnFrontCannonRightDegrees(double angle)
Turns the front cannon towards the right by the amount given in degrees. The cannon will be stopped when it reaches its blindspot. TurnRemaining won't go to 0 when this happens.

Parameters:
angle - The angle in degrees you want to rotate your front cannon to the right.

setTurnFrontCannonLeftRadians

void setTurnFrontCannonLeftRadians(double angle)
Turns the front cannon towards the left by the amount given in radians. The cannon will be stopped when it reaches its blindspot. TurnRemaining won't go to 0 when this happens.

Parameters:
angle - The angle in radians you want to rotate your front cannon to the left.

setTurnFrontCannonRightRadians

void setTurnFrontCannonRightRadians(double angle)
Turns the front cannon towards the right by the amount given in radians. The cannon will be stopped when it reaches its blindspot. TurnRemaining won't go to 0 when this happens.

Parameters:
angle - The angle in radians you want to rotate your front cannon to the right.

getFrontCannonHeadingRadians

double getFrontCannonHeadingRadians()
Retrieve the angle the front cannon is heading in radians.

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

getFrontCannonHeadingDegrees

double getFrontCannonHeadingDegrees()
Retrieve the angle the front cannon is heading in degrees.

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

getCopyOfBlindSpotFrontCannon

BlindSpot getCopyOfBlindSpotFrontCannon()
Returns a copy of the BlindSpot that the back cannon has. The BlindSpot offers great utilities that will help you out working with a BlindSpot.

Returns:
The BlindSpot of the back cannon.
See Also:
Furthest you can move to the left, Furthest you can move to the right, Returns whether the destination is within the BlindSpot

getFrontCannonAtBlindSpot

boolean getFrontCannonAtBlindSpot()
Returns true when the blindSpot has been reached for the backCannon

Returns:

getFrontCannonTurnRemainingRadians

double getFrontCannonTurnRemainingRadians()
Returns the amount the Front Cannon still has to turn in radians. Note: When the blindspot is reached, turn remaining will NOT be 0.

Returns:
turnRemaining for Front Cannon in radians.

getFrontCannonTurnRemainingDegrees

double getFrontCannonTurnRemainingDegrees()
Returns the amount the Front Cannon still has to turn in degrees. Note: When the blindspot is reached, turn remaining will NOT be 0.

Returns:
turnRemaining for Front Cannon in degrees.

fireFrontCannon

void fireFrontCannon(double power)
Fires the a bullet/missile from the front cannon with the given power

Parameters:
power - The power you want to shoot your bullet/missile at. The value is a double between 0.1 and 3.0

setFrontCannonColor

void setFrontCannonColor(Color color)
Sets the color of the front cannon. 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 front cannon to be.

getXFrontCannon

double getXFrontCannon()
Returns the current X-coordinate of your front cannon

Returns:
the current X-coordinate of your front cannon

getYFrontCannon

double getYFrontCannon()
Returns the current Y-coordinate of your front cannon

Returns:
the current Y-coordinate of your front cannon

setBulletColorFront

void setBulletColorFront(Color color)
Sets the Bullet Color for the Front Cannon

Parameters:
color - The Color you want the Bullets the Front Cannon shoots to be.


Copyright © 2015 Robocode. All Rights Reserved.