|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrobocode.naval.ComponentBase
robocode.naval.RadarComponent
public class RadarComponent
A class that resembles a radar component for on a ship.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class robocode.naval.ComponentBase |
|---|
ComponentBase.HiddenComponentHelper |
| Field Summary |
|---|
| Fields inherited from class robocode.naval.ComponentBase |
|---|
angle, lastHeading, type |
| Constructor Summary | |
|---|---|
RadarComponent(double x,
double y)
Creates a new radar component for on the robot. |
|
RadarComponent(double x,
double y,
ComponentType type)
Creates a new radar component for on the robot. |
|
RadarComponent(Point2D pivot,
ComponentType type)
Creates a new radar component for on the robot. |
|
| Method Summary | |
|---|---|
Arc2D.Double |
getScanArc()
|
Color |
getScanColor()
|
byte |
getSerializeType()
|
boolean |
insideScanArc(ITransformable peer)
Determines whether or not the peer is inside the scan arc. |
boolean |
insideScanArc(Point2D projectile)
Determines whether or not the projectile is inside the scan arc. |
void |
setScanColor(Color color)
|
double |
turnRadians(double turnRemaining)
Attempts to turn the component. |
void |
updateScanArc(ITransformable shipPeer)
Update the scan arc of the radar. |
| Methods inherited from class robocode.naval.ComponentBase |
|---|
equals, getAngle, getAngleDegrees, getColor, getGunHeat, getLastAngle, getOrigin, getPivot, getType, setAngle, setAngleDegrees, setColor, setLastAngle, setType, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RadarComponent(double x,
double y)
x - The X-coordinate of the pivot point of the component.y - The Y-coordinate of the pivot point of the component.
public RadarComponent(double x,
double y,
ComponentType type)
x - The X-coordinate of the pivot point of the component.y - The Y-coordinate of the pivot point of the component.type - The type of radar component.
public RadarComponent(Point2D pivot,
ComponentType type)
pivot - The pivot point of the component.type - The type of radar component.| Method Detail |
|---|
public double turnRadians(double turnRemaining)
turnRadians in interface IComponentturnRadians in class ComponentBaseturnRemaining - The angle in RADIANS the component still has to turn.
public Color getScanColor()
public void setScanColor(Color color)
public Arc2D.Double getScanArc()
public void updateScanArc(ITransformable shipPeer)
shipPeer - The peer to whom the radar belongs.public boolean insideScanArc(ITransformable peer)
peer is inside the scan arc.
peer - The peer to determine from if it is inside the scan arc.
true when the peer is in the scan arc; false otherwise.public boolean insideScanArc(Point2D projectile)
projectile is inside the scan arc.
projectile - The projectile that has to be inside the scan arc,
true when the projectile is in the scan arc; false otherwise.public byte getSerializeType()
getSerializeType in interface IComponentgetSerializeType in class ComponentBase
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||