public class WarpCommand extends ShipCommand
| Modifier and Type | Field and Description |
|---|---|
static double |
MAX_WARP_DISTANCE |
| Constructor and Description |
|---|
WarpCommand()
Creates a random warp command.
|
WarpCommand(double distance)
Creates a directed warp command.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
getInitialEnergyCost()
Gets the one-time energy cost to initiate this command.
|
java.lang.String |
getName() |
static int |
getOngoingEnergyCost()
Gets the energy cost per second of this command.
|
equals, executesImmediately, getMessage, isBlocking, toStringpublic static final double MAX_WARP_DISTANCE
public WarpCommand()
The ship will be warped a random distance up to 1000 pixels both horizontally and vertically. A random warp has a cool-down period of 5 seconds.
public WarpCommand(double distance)
The ship will be warped the given distance (maximum of 400 pixels) in the direction the ship is
currently facing. A directed warp has a cool-down period of distance / 50.
distance - the distance to warp (maximum 400)public java.lang.String getName()
getName in class ShipCommandpublic static int getInitialEnergyCost()
public static int getOngoingEnergyCost()