robocode.robotinterfaces.peer
Interface IBasicShipPeer

All Superinterfaces:
IBasicRobotPeer

public interface IBasicShipPeer
extends IBasicRobotPeer

An interface that describes all the functions in ShipPeer that are available the call from Ship.

Author:
Thales B.V. / Thomas Hakkers

Method Summary
 Bullet fireComponent(int index)
          WeaponComponent.fire()
 double getAngleComponentRadians(int index)
          Returns the angle of the specified component in Radians
 double getAngleRemainingComponent(int index)
          Returns the angleRemaining of the given index in radians
 boolean getAtBlindSpot(int index)
          Decides whether the specified WeaponComponent is at the edge of its BlindSpot
 BlindSpot getBlindSpotWeapon(int index)
          Returns the BlindSpot of the specified WeaponComponent
 double getFirePowerComponent(int index)
          Returns the firepower for the specified component Only works for WeaponComponents
 double getGunHeatComponent(int index)
          Returns the gunheat of the specified component Only works for WeaponComponents
 Mine mine(double power, int index)
          Places a mine with the given power from the component with the given index.
 void rotate(int index, double angle)
          Rotates the component by the specified angle in degrees.
 void setAdjustComponentForShipTurn(int index, boolean independent)
          Sets whether the component is independent or not
 void setBulletColor(int index, Color color)
          Sets the color for the bullets shot from a WeaponComponent Only works for WeaponComponents.
 void setComponentColor(int index, Color color)
          Sets the color of the specified component
 Bullet setFireComponent(int index)
          Same as fireComponent() This function only executes once the execute() function has been called, instead.
 void setFirePowerComponent(int index, double firepower)
          Sets the firepower for the specified component Only works for WeaponComponents
 Mine setMine(double power, int index)
          Places a mine with the given power from the component with the given index.
 void setScanColor(int index, Color color)
          Sets the color of the Scan.
 
Methods inherited from interface robocode.robotinterfaces.peer.IBasicRobotPeer
execute, fire, getBattleFieldHeight, getBattleFieldWidth, getBodyHeading, getBodyTurnRemaining, getCall, getDistanceRemaining, getEnergy, getGraphics, getGunCoolingRate, getGunHeading, getGunHeat, getGunTurnRemaining, getName, getNumRounds, getNumSentries, getOthers, getRadarHeading, getRadarTurnRemaining, getRoundNum, getSentryBorderSize, getTime, getVelocity, getX, getY, move, rescan, setBodyColor, setBulletColor, setCall, setDebugProperty, setFire, setGunColor, setRadarColor, setScanColor, turnBody, turnGun
 

Method Detail

rotate

void rotate(int index,
            double angle)
Rotates the component by the specified angle in degrees.

Parameters:
index - The index of the component that has to rotate.
angle - The angle to turn the component in degrees.

fireComponent

Bullet fireComponent(int index)
WeaponComponent.fire()

Parameters:
index - The index of the weapon that has to be fired.
Returns:
A Bullet that give a variety of useful variables

setFireComponent

Bullet setFireComponent(int index)
Same as fireComponent() This function only executes once the execute() function has been called, instead. WeaponComponent.fire()

Parameters:
index - The index of the weapon that has to be fired.
Returns:
A Bullet that give a variety of useful variables

getAngleRemainingComponent

double getAngleRemainingComponent(int index)
Returns the angleRemaining of the given index in radians

Parameters:
index - The index of the component you want to know the remaining angle of
Returns:
The angleRemaining of the given componentindex in radians

setAdjustComponentForShipTurn

void setAdjustComponentForShipTurn(int index,
                                   boolean independent)
Sets whether the component is independent or not

Parameters:
index - The index of the component you want to change the dependency of
independent - true for independent movement, false if you want the component to be stuck to the ship.

mine

Mine mine(double power,
          int index)
Places a mine with the given power from the component with the given index.

Parameters:
power - The power of the mine
index - The index of the component that drops the mine
Returns:
A Mine object that contains a variety of useful variables

setMine

Mine setMine(double power,
             int index)
Places a mine with the given power from the component with the given index. Same as mine(double, int), but drops the mine after the execute() function is called.

Parameters:
power - The power of the mine
index - The index of the component that drops the mine
Returns:
A Mine object that contains a variety of useful variables

setComponentColor

void setComponentColor(int index,
                       Color color)
Sets the color of the specified component

Parameters:
index - The index of the component
color - the color you want to give the component

setFirePowerComponent

void setFirePowerComponent(int index,
                           double firepower)
Sets the firepower for the specified component Only works for WeaponComponents

Parameters:
index - The index of the component
firepower - The firepower you want to give the component

getFirePowerComponent

double getFirePowerComponent(int index)
Returns the firepower for the specified component Only works for WeaponComponents

Parameters:
index - the index of the component
Returns:
the firePower of the component

getGunHeatComponent

double getGunHeatComponent(int index)
Returns the gunheat of the specified component Only works for WeaponComponents

Parameters:
index - the index of the specified component
Returns:
The gunheat of the component at the specified index.

getAngleComponentRadians

double getAngleComponentRadians(int index)
Returns the angle of the specified component in Radians

Parameters:
index - The index of the component you want to get the angle from
Returns:
the current angle in radians of the component at the given index

getBlindSpotWeapon

BlindSpot getBlindSpotWeapon(int index)
Returns the BlindSpot of the specified WeaponComponent

Parameters:
index - The index of the specified WeaponComponent
Returns:
the BlindSpot of the specified WeaponComponent

getAtBlindSpot

boolean getAtBlindSpot(int index)
Decides whether the specified WeaponComponent is at the edge of its BlindSpot

Parameters:
index - The index of the specified WeaponComponent
Returns:
true if at the edge of the BlindSpot, false otherwise.

setScanColor

void setScanColor(int index,
                  Color color)
Sets the color of the Scan. Only works for RadarComponents

Parameters:
index - The index of the Radar you want to specify the Scan color for
color - The color you want the give the scan of the Radar.

setBulletColor

void setBulletColor(int index,
                    Color color)
Sets the color for the bullets shot from a WeaponComponent Only works for WeaponComponents. Can be set for seperate WeaponComponents.

Parameters:
index - The index of the WeaponComponent you want to set the color of the bullets for
color - The color you want to give the bullets.


Copyright © 2015 Robocode. All Rights Reserved.