public class RadarCommand extends ShipCommand
There are five levels of radar sweep that can be performed. Higher levels provide more information about objects in range, but also require more time. The levels are as follows:
Level | Duration | Information Gathered |
---|---|---|
1 | 0.03 s | None (number of objects only) |
2 | 0.10 s | ID# and position |
3 | 0.10 s | All (for specified target only) |
4 | 0.15 s | ID#, position, type |
5 | 0.40 s | All |
Performing a RadarCommand will populate the Environment.getRadar()
method's results
on the next call to Spaceship.getNextCommand(ihs.apcs.spacebattle.Environment)
and only the next call.
Results need to be saved to be compared to future Radar sweeps.
Constructor and Description |
---|
RadarCommand(int level)
Creates a command to perform a radar sweep of the specified level.
|
RadarCommand(int level,
int target)
Creates a command to perform a targeted radar sweep to obtain full
details on a particular target.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
static int |
getOngoingEnergyCost()
Gets the energy cost per second of this command.
|
equals, executesImmediately, getInitialEnergyCost, getMessage, isBlocking, toString
public RadarCommand(int level)
level
- the level of sweep to performpublic RadarCommand(int level, int target)
level
- the level of sweep to perform (Must be 3)target
- the id number of the target to scanpublic java.lang.String getName()
getName
in class ShipCommand
public static int getOngoingEnergyCost()