You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
733 B
34 lines
733 B
package mock.model.commandFactory;
|
|
|
|
import mock.model.MockBoat;
|
|
import mock.model.MockRace;
|
|
|
|
/**
|
|
* Command class for autoVMG
|
|
*/
|
|
public class VMGCommand implements Command {
|
|
private MockRace race;
|
|
private MockBoat boat;
|
|
|
|
/**
|
|
* Constructor for class
|
|
* @param race mock race
|
|
* @param boat mock boat to update
|
|
*/
|
|
public VMGCommand(MockRace race, MockBoat boat) {
|
|
this.race = race;
|
|
this.boat = boat;
|
|
}
|
|
|
|
@Override
|
|
public void execute() {
|
|
if (boat.getAutoVMG()){
|
|
boat.setAutoVMG(false);
|
|
System.out.println("Auto VMG off!");
|
|
} else {
|
|
boat.setAutoVMG(true);
|
|
System.out.println("Auto VMG on!");
|
|
}
|
|
}
|
|
}
|