|
|
|
|
@ -7,11 +7,17 @@ import shared.model.Bearing;
|
|
|
|
|
import java.util.Observable;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created by connortaylorbrown on 4/08/17.
|
|
|
|
|
* Command class for upwind and downwind controls
|
|
|
|
|
*/
|
|
|
|
|
public class WindCommand extends ObserverCommand {
|
|
|
|
|
private int direction;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructor for class
|
|
|
|
|
* @param race race context
|
|
|
|
|
* @param boat boat controlled by command
|
|
|
|
|
* @param upwind if true, downwind if false
|
|
|
|
|
*/
|
|
|
|
|
public WindCommand(MockRace race, MockBoat boat, boolean upwind) {
|
|
|
|
|
super(race, boat);
|
|
|
|
|
this.direction = upwind? -1 : 1;
|
|
|
|
|
|