public class ThrustCommand extends ShipCommand
Constructor and Description |
---|
ThrustCommand(char dir,
double duration,
double power)
Creates a blocking command to fire a ship's thrusters.
|
ThrustCommand(char dir,
double duration,
double power,
boolean block)
Creates a command to fire a ship's thrusters.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
static int |
getOngoingEnergyCost()
Gets the energy cost per second of this command.
|
static boolean |
isBlocking()
Thrust commands will prevent you from executing other commands by default, pass a 'false' block argument to change this behavior.
|
equals, executesImmediately, getInitialEnergyCost, getMessage, toString
public ThrustCommand(char dir, double duration, double power)
dir
- which thruster to fire (one of 'B', 'F', 'L', 'R')duration
- the number of seconds to thrustpower
- the percentage of thruster power to be used for this thrustpublic ThrustCommand(char dir, double duration, double power, boolean block)
dir
- which thruster to fire (one of 'B', 'F', 'L', 'R')duration
- the number of seconds to thrustpower
- the percentage of thruster power to be used for this thrustblock
- indicates if the command should block or notpublic java.lang.String getName()
getName
in class ShipCommand
public static int getOngoingEnergyCost()
public static boolean isBlocking()