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);
        } else {
            boat.setAutoVMG(true);
        }
    }
}
