Partially removed VMG optimisation, separated server-specific functionality
from MockRace into RaceServer. #story[1094]
This commit is contained in:
@@ -135,20 +135,9 @@ public class MockBoat extends Boat {
|
||||
/**
|
||||
* Moves the boat meters forward in the direction that it is facing
|
||||
* @param meters The number of meters to move forward.
|
||||
* @param milliseconds The number of milliseconds to advance the boat's timers by.
|
||||
*
|
||||
*/
|
||||
public void moveForwards(double meters, long milliseconds) {
|
||||
|
||||
|
||||
//Update the boat's time since last tack.
|
||||
this.setTimeSinceTackChange(this.getTimeSinceTackChange() + milliseconds);
|
||||
|
||||
//Update the time into the current leg.
|
||||
this.setTimeElapsedInCurrentLeg(this.getTimeElapsedInCurrentLeg() + milliseconds);
|
||||
|
||||
//Update the distance into the current leg.
|
||||
this.setDistanceTravelledInLeg(this.getDistanceTravelledInLeg() + meters);
|
||||
|
||||
public void moveForwards(double meters) {
|
||||
//Updates the current position of the boat.
|
||||
GPSCoordinate newPosition = GPSCoordinate.calculateNewPosition(this.getCurrentPosition(), meters, Azimuth.fromBearing(this.getBearing()));
|
||||
this.setCurrentPosition(newPosition);
|
||||
|
||||
Reference in New Issue
Block a user