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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user