Merge branch 'issue_#67_early_start' into 'develop'

added a check in the start logic to make sure a boat can't cross the start line early



See merge request !74
This commit is contained in:
Haoming Yin
2017-09-27 19:42:05 +13:00
@@ -736,6 +736,10 @@ public class GameState implements Runnable {
* @param yacht The current yacht to check for * @param yacht The current yacht to check for
*/ */
private Boolean checkStartLineCrossing(ServerYacht yacht) { private Boolean checkStartLineCrossing(ServerYacht yacht) {
long timeTillStart = System.currentTimeMillis() - this.getStartTime();
if (timeTillStart < 0){
return false;
}
Integer currentMarkSeqID = yacht.getCurrentMarkSeqID(); Integer currentMarkSeqID = yacht.getCurrentMarkSeqID();
CompoundMark currentMark = markOrder.getCurrentMark(currentMarkSeqID); CompoundMark currentMark = markOrder.getCurrentMark(currentMarkSeqID);
GeoPoint lastLocation = yacht.getLastLocation(); GeoPoint lastLocation = yacht.getLastLocation();