robocode.naval.interfaces
Interface IBackCannonFunctions

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

public interface IBackCannonFunctions

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

Method Summary
 void fireBackCannon(double power)
          Fires the a bullet/missile from the back cannon with the given power
 boolean getBackCannonAtBlindSpot()
          Returns true when the blindSpot has been reached for the backCannon
 double getBackCannonHeadingDegrees()
          Retrieve the angle the back cannon is heading in degrees.
 double getBackCannonHeadingRadians()
          Retrieve the angle the back cannon is heading in radians.
 double getBackCannonTurnRemainingDegrees()
          Returns the amount the Back Cannon still has to turn in degrees.
 double getBackCannonTurnRemainingRadians()
          Returns the amount the Back Cannon still has to turn in radians.
 BlindSpot getCopyOfBlindSpotBackCannon()
          Returns a copy of the BlindSpot that the back cannon has.
 double getXBackCannon()
          Returns the current X-coordinate of your back cannon
 double getYBackCannon()
          Returns the current Y-coordinate of your back cannon
 void setBackCannonColor(Color color)
          Sets the color of the back cannon.
 void setBulletColorBack(Color color)
          Sets the Bullet Color for the Back Cannon
 void setTurnBackCannonLeftDegrees(double angle)
          Turns the back cannon towards the left by the amount given in degrees.
 void setTurnBackCannonLeftRadians(double angle)
          Turns the back cannon towards the left by the amount given in radians.
 void setTurnBackCannonRightDegrees(double angle)
          Turns the back cannon towards the right by the amount given in degrees.
 void setTurnBackCannonRightRadians(double angle)
          Turns the back cannon towards the right by the amount given in radians.
 

Method Detail

setTurnBackCannonLeftDegrees

void setTurnBackCannonLeftDegrees(double angle)
Turns the back 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 back cannon to the left.

setTurnBackCannonRightDegrees

void setTurnBackCannonRightDegrees(double angle)
Turns the back 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 back cannon to the right.

setTurnBackCannonLeftRadians

void setTurnBackCannonLeftRadians(double angle)
Turns the back 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 back cannon to the left.

setTurnBackCannonRightRadians

void setTurnBackCannonRightRadians(double angle)
Turns the back 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 back cannon to the right.

getBackCannonHeadingRadians

double getBackCannonHeadingRadians()
Retrieve the angle the back cannon is heading in radians.

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

getBackCannonHeadingDegrees

double getBackCannonHeadingDegrees()
Retrieve the angle the back cannon is heading in degrees.

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

getCopyOfBlindSpotBackCannon

BlindSpot getCopyOfBlindSpotBackCannon()
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

getBackCannonAtBlindSpot

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

Returns:

getBackCannonTurnRemainingRadians

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

Returns:
turnRemaining for Back Cannon in radians.

getBackCannonTurnRemainingDegrees

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

Returns:
turnRemaining for Back Cannon in degrees.

fireBackCannon

void fireBackCannon(double power)
Fires the a bullet/missile from the back 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

setBackCannonColor

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

getXBackCannon

double getXBackCannon()
Returns the current X-coordinate of your back cannon

Returns:
the current X-coordinate of your back cannon

getYBackCannon

double getYBackCannon()
Returns the current Y-coordinate of your back cannon

Returns:
the current Y-coordinate of your back cannon

setBulletColorBack

void setBulletColorBack(Color color)
Sets the Bullet Color for the Back Cannon

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


Copyright © 2015 Robocode. All Rights Reserved.