Boats now store whether autoVMG is on or off, boat speed scales off their bearing relative to the TWA. #story[1094]

This commit is contained in:
Joseph Gardner
2017-08-03 16:56:52 +12:00
parent c8621a7be5
commit 40a3ed1bb0
4 changed files with 286 additions and 24 deletions
@@ -4,6 +4,7 @@ import javafx.animation.AnimationTimer;
import network.Messages.Enums.BoatStatusEnum;
import network.Messages.Enums.RaceStatusEnum;
import network.Messages.LatestMessages;
import shared.model.Race;
public class RaceLogic implements Runnable {
/**
@@ -100,6 +101,8 @@ public class RaceLogic implements Runnable {
*/
long lastFrameTime = timeRaceStarted;
long framePeriod = currentTime - lastFrameTime;
@Override
public void handle(long arg0) {
@@ -109,12 +112,11 @@ public class RaceLogic implements Runnable {
//Update race time.
race.updateRaceTime(currentTime);
//As long as there is at least one boat racing, we still simulate the race.
if (race.getNumberOfActiveBoats() != 0) {
//Get the time period of this frame.
long framePeriod = currentTime - lastFrameTime;
framePeriod = currentTime - lastFrameTime;
//For each boat, we update its position, and generate a BoatLocationMessage.
for (MockBoat boat : race.getBoats()) {