removed outdated comments
#story[1087]
This commit is contained in:
@@ -71,6 +71,8 @@ public class MockBoat extends Boat {
|
|||||||
//Get the start and end points.
|
//Get the start and end points.
|
||||||
GPSCoordinate currentPosition = this.getCurrentPosition();
|
GPSCoordinate currentPosition = this.getCurrentPosition();
|
||||||
GPSCoordinate nextMarkerPosition = this.getCurrentLeg().getEndCompoundMark().getAverageGPSCoordinate();
|
GPSCoordinate nextMarkerPosition = this.getCurrentLeg().getEndCompoundMark().getAverageGPSCoordinate();
|
||||||
|
// GPSCoordinate nextMarkerPosition = this.getCurrentLeg().getEndCompoundMark().getMark1Position();
|
||||||
|
// todo:may need to change this so that boats are send to corners of the gates rather than the middle
|
||||||
|
|
||||||
//Calculate bearing.
|
//Calculate bearing.
|
||||||
Bearing bearing = GPSCoordinate.calculateBearing(currentPosition, nextMarkerPosition);
|
Bearing bearing = GPSCoordinate.calculateBearing(currentPosition, nextMarkerPosition);
|
||||||
|
|||||||
@@ -779,7 +779,7 @@ public class MockRace extends Race {
|
|||||||
//boats must pass all checks in order to round a mark
|
//boats must pass all checks in order to round a mark
|
||||||
switch (boat.getRoundingStatus()) {
|
switch (boat.getRoundingStatus()) {
|
||||||
case 0://hasn't started rounding
|
case 0://hasn't started rounding
|
||||||
System.out.println("round 0");
|
// System.out.println("round 0");
|
||||||
if (boat.isPortSide(boat.getCurrentLeg().getEndCompoundMark().getMark1()) &&
|
if (boat.isPortSide(boat.getCurrentLeg().getEndCompoundMark().getMark1()) &&
|
||||||
GPSCoordinate.intersects(boat.getCurrentLeg().getEndCompoundMark().getMark1().getPosition(),
|
GPSCoordinate.intersects(boat.getCurrentLeg().getEndCompoundMark().getMark1().getPosition(),
|
||||||
roundingChecks.get(0), boat.getCurrentPosition())) {
|
roundingChecks.get(0), boat.getCurrentPosition())) {
|
||||||
@@ -787,7 +787,7 @@ public class MockRace extends Race {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1://has been parallel to the mark
|
case 1://has been parallel to the mark
|
||||||
System.out.println("round 1");
|
// System.out.println("round 1");
|
||||||
if (boat.isPortSide(boat.getCurrentLeg().getEndCompoundMark().getMark1()) &&
|
if (boat.isPortSide(boat.getCurrentLeg().getEndCompoundMark().getMark1()) &&
|
||||||
GPSCoordinate.intersects(boat.getCurrentLeg().getEndCompoundMark().getMark1().getPosition(),
|
GPSCoordinate.intersects(boat.getCurrentLeg().getEndCompoundMark().getMark1().getPosition(),
|
||||||
roundingChecks.get(1), boat.getCurrentPosition())) {
|
roundingChecks.get(1), boat.getCurrentPosition())) {
|
||||||
@@ -795,7 +795,7 @@ public class MockRace extends Race {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2://has traveled 180 degrees around the mark
|
case 2://has traveled 180 degrees around the mark
|
||||||
System.out.println("round 2");
|
// System.out.println("round 2");
|
||||||
//Move boat on to next leg.
|
//Move boat on to next leg.
|
||||||
boat.resetRoundingStatus();
|
boat.resetRoundingStatus();
|
||||||
Leg nextLeg = this.legs.get(boat.getCurrentLeg().getLegNumber() + 1);
|
Leg nextLeg = this.legs.get(boat.getCurrentLeg().getLegNumber() + 1);
|
||||||
@@ -840,7 +840,7 @@ public class MockRace extends Race {
|
|||||||
* @param boat The boat to check.
|
* @param boat The boat to check.
|
||||||
* @param timeElapsed The total time, in milliseconds, that has elapsed since the race started.
|
* @param timeElapsed The total time, in milliseconds, that has elapsed since the race started.
|
||||||
*/
|
*/
|
||||||
protected void checkPosition(MockBoat boat, long timeElapsed) {//TODO cater for gates (SP or PS in the switch)
|
protected void checkPosition(MockBoat boat, long timeElapsed) {
|
||||||
|
|
||||||
//The distance, in nautical miles, within which the boat needs to get in order to consider that it has reached the marker.
|
//The distance, in nautical miles, within which the boat needs to get in order to consider that it has reached the marker.
|
||||||
double epsilonNauticalMiles = 250.0 / Constants.NMToMetersConversion; //250 meters.
|
double epsilonNauticalMiles = 250.0 / Constants.NMToMetersConversion; //250 meters.
|
||||||
@@ -864,7 +864,7 @@ public class MockRace extends Race {
|
|||||||
|
|
||||||
List<GPSCoordinate> roundingChecks = new ArrayList<GPSCoordinate>(Arrays.asList(roundCheck1, roundCheck2));
|
List<GPSCoordinate> roundingChecks = new ArrayList<GPSCoordinate>(Arrays.asList(roundCheck1, roundCheck2));
|
||||||
|
|
||||||
switch (boat.getCurrentLeg().getEndCompoundMark().getRoundingType()) {//todo may need to implement SP and PS
|
switch (boat.getCurrentLeg().getEndCompoundMark().getRoundingType()) {
|
||||||
case SP://Not yet implemented so these gates will be rounded port side
|
case SP://Not yet implemented so these gates will be rounded port side
|
||||||
case Port:
|
case Port:
|
||||||
boatRoundingCheckPort(boat, roundingChecks);
|
boatRoundingCheckPort(boat, roundingChecks);
|
||||||
|
|||||||
Reference in New Issue
Block a user