starboard rounding update
#story[1101]
This commit is contained in:
@@ -474,7 +474,6 @@ public class MockRace extends Race {
|
|||||||
if (boat.isPortSide(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing)) &&
|
if (boat.isPortSide(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing)) &&
|
||||||
GPSCoordinate.passesLine(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing).getPosition(),
|
GPSCoordinate.passesLine(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing).getPosition(),
|
||||||
roundingChecks.get(0), boat.getCurrentPosition(), legBearing)) {
|
roundingChecks.get(0), boat.getCurrentPosition(), legBearing)) {
|
||||||
System.out.println("true");
|
|
||||||
boat.increaseRoundingStatus();
|
boat.increaseRoundingStatus();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -482,7 +481,7 @@ public class MockRace extends Race {
|
|||||||
// System.out.println("round 1");
|
// System.out.println("round 1");
|
||||||
if (boat.isPortSide(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing)) &&
|
if (boat.isPortSide(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing)) &&
|
||||||
GPSCoordinate.passesLine(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing).getPosition(),
|
GPSCoordinate.passesLine(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing).getPosition(),
|
||||||
roundingChecks.get(1), boat.getCurrentPosition(), Bearing.fromDegrees(legBearing.degrees() - 90))) {//negitive 90 from bearing because of port rounding
|
roundingChecks.get(1), boat.getCurrentPosition(), Bearing.fromDegrees(legBearing.degrees() - 90))) {//negative 90 from bearing because of port rounding
|
||||||
boat.increaseRoundingStatus();
|
boat.increaseRoundingStatus();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -501,20 +500,20 @@ public class MockRace extends Race {
|
|||||||
* @param boat the boat that is rounding a mark
|
* @param boat the boat that is rounding a mark
|
||||||
* @param roundingChecks the checks to run
|
* @param roundingChecks the checks to run
|
||||||
*/
|
*/
|
||||||
private void boatRoundingCheckStarboard(MockBoat boat, List<GPSCoordinate> roundingChecks){
|
private void boatRoundingCheckStarboard(MockBoat boat, List<GPSCoordinate> roundingChecks, Bearing legBearing){
|
||||||
//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
|
||||||
if (boat.isStarboardSide(boat.getCurrentLeg().getEndCompoundMark().getMark1()) &&
|
if (boat.isPortSide(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing)) &&
|
||||||
GPSCoordinate.intersects(boat.getCurrentLeg().getEndCompoundMark().getMark1().getPosition(),
|
GPSCoordinate.passesLine(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing).getPosition(),
|
||||||
roundingChecks.get(0), boat.getCurrentPosition())) {
|
roundingChecks.get(0), boat.getCurrentPosition(), legBearing)) {
|
||||||
boat.increaseRoundingStatus();
|
boat.increaseRoundingStatus();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1://has been parallel to the mark
|
case 1://has been parallel to the mark
|
||||||
if (boat.isStarboardSide(boat.getCurrentLeg().getEndCompoundMark().getMark1()) &&
|
if (boat.isPortSide(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing)) &&
|
||||||
GPSCoordinate.intersects(boat.getCurrentLeg().getEndCompoundMark().getMark1().getPosition(),
|
GPSCoordinate.passesLine(boat.getCurrentLeg().getEndCompoundMark().getMarkForRounding(legBearing).getPosition(),
|
||||||
roundingChecks.get(1), boat.getCurrentPosition())) {
|
roundingChecks.get(1), boat.getCurrentPosition(), Bearing.fromDegrees(legBearing.degrees() + 90))) {//positive 90 from bearing because of starboard rounding
|
||||||
boat.increaseRoundingStatus();
|
boat.increaseRoundingStatus();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -560,7 +559,7 @@ public class MockRace extends Race {
|
|||||||
break;
|
break;
|
||||||
case PS://not yet implemented so these gates will be rounded starboard side
|
case PS://not yet implemented so these gates will be rounded starboard side
|
||||||
case Starboard:
|
case Starboard:
|
||||||
boatRoundingCheckStarboard(boat, roundingChecks);
|
boatRoundingCheckStarboard(boat, roundingChecks, bearingOfDirectionLine);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<Corner SeqID="1" CompoundMarkID="1" Rounding="SP" ZoneSize="3" />
|
<Corner SeqID="1" CompoundMarkID="1" Rounding="SP" ZoneSize="3" />
|
||||||
<Corner SeqID="2" CompoundMarkID="2" Rounding="Port" ZoneSize="3" />
|
<Corner SeqID="2" CompoundMarkID="2" Rounding="Port" ZoneSize="3" />
|
||||||
<Corner SeqID="3" CompoundMarkID="4" Rounding="Port" ZoneSize="3" />
|
<Corner SeqID="3" CompoundMarkID="4" Rounding="Port" ZoneSize="3" />
|
||||||
<Corner SeqID="4" CompoundMarkID="3" Rounding="Port" ZoneSize="3" />
|
<Corner SeqID="4" CompoundMarkID="3" Rounding="Starboard" ZoneSize="3" />
|
||||||
<Corner SeqID="5" CompoundMarkID="4" Rounding="Port" ZoneSize="3" />
|
<Corner SeqID="5" CompoundMarkID="4" Rounding="Port" ZoneSize="3" />
|
||||||
<Corner SeqID="6" CompoundMarkID="5" Rounding="SP" ZoneSize="3"/>
|
<Corner SeqID="6" CompoundMarkID="5" Rounding="SP" ZoneSize="3"/>
|
||||||
</CompoundMarkSequence>
|
</CompoundMarkSequence>
|
||||||
|
|||||||
Reference in New Issue
Block a user