Merge branch 'master' into new_issue#19
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package mock.model;
|
||||
|
||||
import javafx.animation.AnimationTimer;
|
||||
import mock.xml.*;
|
||||
import network.Messages.BoatLocation;
|
||||
import network.Messages.BoatStatus;
|
||||
import network.Messages.Enums.BoatStatusEnum;
|
||||
import network.Messages.Enums.RaceStatusEnum;
|
||||
import shared.dataInput.BoatDataSource;
|
||||
@@ -8,6 +12,8 @@ import shared.dataInput.RegattaDataSource;
|
||||
import shared.exceptions.BoatNotFoundException;
|
||||
import shared.enums.RoundingType;
|
||||
import shared.model.*;
|
||||
import shared.model.Bearing;
|
||||
import shared.model.Race;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
@@ -392,7 +398,7 @@ public class MockRace extends Race {
|
||||
double lastAngle = -1;
|
||||
boolean lastAngleWasGood = false;
|
||||
|
||||
//Check all bearings between [0, 360).
|
||||
//Check all bearings between [0, 360)
|
||||
for (double angle = 0; angle < 360; angle += 1) {
|
||||
|
||||
//Create bearing from angle.
|
||||
@@ -628,7 +634,6 @@ public class MockRace extends Race {
|
||||
protected int getNumberOfActiveBoats() {
|
||||
|
||||
int numberOfActiveBoats = 0;
|
||||
|
||||
for (MockBoat boat : this.boats) {
|
||||
|
||||
//If the boat is currently racing, count it.
|
||||
@@ -701,6 +706,7 @@ public class MockRace extends Race {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public List<CompoundMark> getCompoundMarks() {
|
||||
return compoundMarks;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,9 +194,9 @@ public class RaceLogic implements RunnableWithFramePeriod, Observer {
|
||||
public void update(Observable o, Object arg) {
|
||||
Collision e = (Collision)arg;
|
||||
|
||||
if(e.getBearing().degrees() == 0) System.out.println("Ahead");
|
||||
else if(e.getBearing().degrees() < 90) System.out.println("Starboard");
|
||||
else if(e.getBearing().degrees() > 270) System.out.println("Port");
|
||||
else System.out.println("Behind");
|
||||
// if(e.getBearing().degrees() == 0) System.out.println("Ahead");
|
||||
// else if(e.getBearing().degrees() < 90) System.out.println("Starboard");
|
||||
// else if(e.getBearing().degrees() > 270) System.out.println("Port");
|
||||
// else System.out.println("Behind");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user