Merge remote-tracking branch 'remotes/origin/master' into story77
# Conflicts: # racevisionGame/src/main/java/mock/app/Event.java # racevisionGame/src/main/java/visualiser/Controllers/HostController.java # racevisionGame/src/main/java/visualiser/Controllers/LobbyController.java # racevisionGame/src/main/java/visualiser/Controllers/MainController.java # racevisionGame/src/main/resources/visualiser/scenes/main.fxml # settings/keyBindings.xml
This commit is contained in:
@@ -2,14 +2,16 @@ package mock.app;
|
||||
|
||||
import mock.dataInput.PolarParser;
|
||||
import mock.exceptions.EventConstructionException;
|
||||
import mock.model.*;
|
||||
import mock.model.MockRace;
|
||||
import mock.model.Polars;
|
||||
import mock.model.RaceLogic;
|
||||
import mock.model.SourceIdAllocator;
|
||||
import mock.model.commandFactory.CompositeCommand;
|
||||
import network.Messages.Enums.RaceStatusEnum;
|
||||
import network.Messages.HostGame;
|
||||
import mock.model.wind.RandomWindGenerator;
|
||||
import mock.model.wind.ShiftingWindGenerator;
|
||||
import mock.model.wind.WindGenerator;
|
||||
import mock.xml.RaceXMLCreator;
|
||||
import network.Messages.LatestMessages;
|
||||
import shared.dataInput.*;
|
||||
import shared.enums.XMLFileType;
|
||||
@@ -19,21 +21,13 @@ import shared.exceptions.InvalidRegattaDataException;
|
||||
import shared.exceptions.XMLReaderException;
|
||||
import shared.model.Bearing;
|
||||
import shared.model.Constants;
|
||||
import shared.xml.XMLUtilities;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import java.io.IOException;
|
||||
import java.net.Inet4Address;
|
||||
import java.net.InetAddress;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,10 +21,9 @@ import java.util.logging.Logger;
|
||||
* Created by connortaylorbrown on 2/08/17.
|
||||
*/
|
||||
public class RaceServer {
|
||||
private static RaceServer server;//this is for updating xml files as I cannot find an elegant way to do this and since it is near the end of the sprint we shouldn't be doing large scale refactors
|
||||
|
||||
private MockRace race;
|
||||
private LatestMessages latestMessages;
|
||||
private static RaceServer server;
|
||||
|
||||
|
||||
/**
|
||||
@@ -54,6 +53,12 @@ public class RaceServer {
|
||||
this.latestMessages = latestMessages;
|
||||
}
|
||||
|
||||
public static void staticUpdateXML() {
|
||||
if (server != null) {
|
||||
server.updateXMLFiles();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the race to create a snapshot, and places it in latestMessages.
|
||||
*/
|
||||
@@ -75,13 +80,6 @@ public class RaceServer {
|
||||
updateXMLFiles();
|
||||
}
|
||||
|
||||
|
||||
public static void staticUpdateXML(){
|
||||
if (server != null){
|
||||
server.updateXMLFiles();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the race/boat/regatta data sources have changed, and if they have, update their xml representations.
|
||||
*/
|
||||
|
||||
@@ -1,34 +1,22 @@
|
||||
package mock.xml;
|
||||
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.SAXException;
|
||||
import shared.dataInput.RaceXMLReader;
|
||||
import shared.enums.XMLFileType;
|
||||
import shared.exceptions.InvalidRaceDataException;
|
||||
import shared.exceptions.XMLReaderException;
|
||||
import shared.model.*;
|
||||
import shared.xml.Race.*;
|
||||
import shared.model.CompoundMark;
|
||||
import shared.model.Constants;
|
||||
import shared.model.GPSCoordinate;
|
||||
import shared.xml.Race.XMLCompoundMark;
|
||||
import shared.xml.Race.XMLLimit;
|
||||
import shared.xml.Race.XMLMark;
|
||||
import shared.xml.Race.XMLRace;
|
||||
import shared.xml.XMLUtilities;
|
||||
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
import javax.xml.bind.util.JAXBSource;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.validation.Schema;
|
||||
import javax.xml.validation.SchemaFactory;
|
||||
import javax.xml.validation.Validator;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.math.BigInteger;
|
||||
import java.net.URL;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user