Refactored mock.Event to work with MockRace.
Fixed the networking imports. Race now keeps a reference to its Race, Boat, and Regatta data sources. VisualiserRace can be provided with new Race/Boat/Regatta data sources during runtime. Currently it updates boundary and legs with a new RaceDataSource, and marker boats with a new BoatDataSource.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
package network.MessageDecoders;
|
||||
|
||||
import seng302.Networking.Messages.AverageWind;
|
||||
import seng302.Networking.Utils.ByteConverter;
|
||||
|
||||
import network.Messages.AverageWind;
|
||||
import network.Utils.ByteConverter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package network.MessageDecoders;
|
||||
|
||||
import seng302.Networking.Messages.BoatLocation;
|
||||
|
||||
import network.Messages.BoatLocation;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static seng302.Networking.Utils.ByteConverter.*;
|
||||
import static network.Utils.ByteConverter.bytesToInt;
|
||||
import static network.Utils.ByteConverter.bytesToLong;
|
||||
import static network.Utils.ByteConverter.bytesToShort;
|
||||
|
||||
|
||||
/**
|
||||
* Created by hba56 on 21/04/17.
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package network.MessageDecoders;
|
||||
|
||||
import seng302.Networking.Messages.CourseWind;
|
||||
|
||||
import network.Messages.CourseWind;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static seng302.Networking.Utils.ByteConverter.*;
|
||||
import static network.Utils.ByteConverter.bytesToInt;
|
||||
import static network.Utils.ByteConverter.bytesToLong;
|
||||
|
||||
|
||||
/**
|
||||
* Created by hba56 on 23/04/17.
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package network.MessageDecoders;
|
||||
|
||||
import seng302.Networking.Messages.MarkRounding;
|
||||
import seng302.Networking.Utils.ByteConverter;
|
||||
|
||||
import network.Messages.MarkRounding;
|
||||
import network.Utils.ByteConverter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@ package network.MessageDecoders;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static seng302.Networking.Utils.ByteConverter.*;
|
||||
import static network.Utils.ByteConverter.*;
|
||||
|
||||
|
||||
/**
|
||||
* Created by hba56 on 21/04/17.
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package network.MessageDecoders;
|
||||
|
||||
import seng302.Networking.Messages.BoatStatus;
|
||||
|
||||
import network.Messages.BoatStatus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static seng302.Networking.Utils.ByteConverter.*;
|
||||
import static network.Utils.ByteConverter.bytesToInt;
|
||||
import static network.Utils.ByteConverter.bytesToLong;
|
||||
import static network.Utils.ByteConverter.bytesToShort;
|
||||
|
||||
|
||||
/**
|
||||
* Created by hba56 on 21/04/17.
|
||||
@@ -24,7 +28,7 @@ public class RaceStatusDecoder {
|
||||
|
||||
private long time;
|
||||
private int race;
|
||||
private int raceState;
|
||||
private byte raceState;
|
||||
private long startTime;
|
||||
private int raceWindDir;
|
||||
private short raceWindSpeed;
|
||||
@@ -47,7 +51,7 @@ public class RaceStatusDecoder {
|
||||
|
||||
time = bytesToLong(timeBytes);
|
||||
race = bytesToInt(raceID);
|
||||
raceState = bytesToInt(raceStatus);
|
||||
raceState = raceStatus;
|
||||
startTime = bytesToLong(expectedStart);
|
||||
raceWindDir = bytesToInt(raceWind);
|
||||
raceWindSpeed = bytesToShort(windSpeed);
|
||||
@@ -87,7 +91,7 @@ public class RaceStatusDecoder {
|
||||
return race;
|
||||
}
|
||||
|
||||
public int getRaceState() {
|
||||
public byte getRaceState() {
|
||||
return raceState;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,9 @@ import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
|
||||
import static seng302.Networking.Utils.ByteConverter.bytesToLong;
|
||||
import static seng302.Networking.Utils.ByteConverter.bytesToShort;
|
||||
import static network.Utils.ByteConverter.bytesToLong;
|
||||
import static network.Utils.ByteConverter.bytesToShort;
|
||||
|
||||
|
||||
/**
|
||||
* Created by hba56 on 20/04/17.
|
||||
|
||||
Reference in New Issue
Block a user