mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Polar velocities should now work as intended.
Snapping to VMG still needs to be implemented. Still an issue of not being able to pass the total upwind or downwind point tags: #story[986]
This commit is contained in:
@@ -2,6 +2,7 @@ package seng302.gameServer;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import seng302.client.ClientPacketParser;
|
||||
import seng302.models.Player;
|
||||
|
||||
import seng302.models.Yacht;
|
||||
@@ -80,10 +81,14 @@ public class GameState {
|
||||
return windDirection;
|
||||
}
|
||||
|
||||
public static Double getWindSpeed() {
|
||||
public static Double getWindSpeedMMS() {
|
||||
return windSpeed;
|
||||
}
|
||||
|
||||
public static Double getWindSpeedKnots() {
|
||||
return windSpeed / 1000 * ClientPacketParser.MS_TO_KNOTS;
|
||||
}
|
||||
|
||||
public static Map<Integer, Yacht> getYachts() {
|
||||
return yachts;
|
||||
}
|
||||
@@ -93,6 +98,7 @@ public class GameState {
|
||||
// System.out.println("-----------------------");
|
||||
switch (actionType) {
|
||||
case VMG:
|
||||
playerYacht.turnToVMG();
|
||||
// System.out.println("Snapping to VMG");
|
||||
// TODO: 22/07/17 wmu16 - Add in the vmg calculation code here
|
||||
break;
|
||||
@@ -118,12 +124,13 @@ public class GameState {
|
||||
break;
|
||||
}
|
||||
|
||||
// System.out.println("-----------------------");
|
||||
// System.out.println("Heading: " + playerYacht.getHeading());
|
||||
// System.out.println("Sails are in: " + playerYacht.getSailIn());
|
||||
// System.out.println("Lat: " + playerYacht.getLocation().getLat());
|
||||
// System.out.println("Lng: " + playerYacht.getLocation().getLng());
|
||||
// System.out.println("-----------------------\n");
|
||||
System.out.println("-----------------------");
|
||||
System.out.println("Sails are in: " + playerYacht.getSailIn());
|
||||
System.out.println("Heading: " + playerYacht.getHeading());
|
||||
System.out.println("Velocity: " + playerYacht.getVelocityMMS() / 1000);
|
||||
System.out.println("Lat: " + playerYacht.getLocation().getLat());
|
||||
System.out.println("Lng: " + playerYacht.getLocation().getLng());
|
||||
System.out.println("-----------------------\n");
|
||||
}
|
||||
|
||||
public static void update() {
|
||||
|
||||
Reference in New Issue
Block a user