Merge branch 'master' of https://eng-git.canterbury.ac.nz/seng302-2017/team-7 into controllerSplit
# Conflicts: # racevisionGame/src/main/java/visualiser/Controllers/HostGameController.java # racevisionGame/src/main/java/visualiser/Controllers/RaceViewController.java # racevisionGame/src/main/java/visualiser/Controllers/StartController.java # racevisionGame/src/main/java/visualiser/Controllers/hostgame.fxml # racevisionGame/src/main/java/visualiser/Controllers/lobbyHosting.fxml # racevisionGame/src/main/java/visualiser/Controllers/main.fxml # racevisionGame/src/main/java/visualiser/Controllers/raceView.fxml
This commit is contained in:
@@ -18,6 +18,7 @@ import shared.exceptions.InvalidRegattaDataException;
|
||||
import shared.exceptions.XMLReaderException;
|
||||
import shared.model.Bearing;
|
||||
import shared.model.Constants;
|
||||
import shared.xml.XMLUtilities;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -72,9 +73,24 @@ public class Event {
|
||||
* @param singlePlayer Whether or not to create a single player event.
|
||||
* @throws EventConstructionException Thrown if we cannot create an Event for any reason.
|
||||
*/
|
||||
public Event(boolean singlePlayer) throws EventConstructionException {
|
||||
public Event(boolean singlePlayer, int mapIndex) throws EventConstructionException {
|
||||
|
||||
String raceXMLFile = "mock/mockXML/raceTest.xml";
|
||||
// System.out.println(XMLUtilities.validateXML(this.getClass().getClassLoader().getResource("mock/mockXML/iMapLayout.xml").toString()
|
||||
// , this.getClass().getClassLoader().getResource("mock/mockXML/schema/raceSchema.xsd")));
|
||||
|
||||
String raceXMLFile;
|
||||
switch (mapIndex){
|
||||
case 0:raceXMLFile = "mock/mockXML/raceSixPlayers.xml";
|
||||
break;
|
||||
case 1:raceXMLFile = "mock/mockXML/oMapLayout.xml";
|
||||
break;
|
||||
case 2: raceXMLFile = "mock/mockXML/iMapLayout.xml";
|
||||
break;
|
||||
case 3: raceXMLFile = "mock/mockXML/mMapLayout.xml";
|
||||
break;
|
||||
default: raceXMLFile = "mock/mockXML/raceSixPlayers.xml";
|
||||
|
||||
}
|
||||
String boatsXMLFile = "mock/mockXML/boatTest.xml";
|
||||
String regattaXMLFile = "mock/mockXML/regattaTest.xml";
|
||||
|
||||
@@ -173,7 +189,7 @@ public class Event {
|
||||
public static String setRaceXMLAtCurrentTimeToNow(String raceXML) {
|
||||
|
||||
//The start time is current time + 4 minutes. prestart is 3 minutes, and we add another minute.
|
||||
long millisecondsToAdd = Constants.RacePreStartTime + (1 * 60 * 1000);
|
||||
long millisecondsToAdd = Constants.RacePreStartTime + Constants.RacePreparatoryTime;
|
||||
long secondsToAdd = millisecondsToAdd / 1000;
|
||||
//Scale the time using our time scalar.
|
||||
secondsToAdd = secondsToAdd / Constants.RaceTimeScale;
|
||||
|
||||
@@ -42,6 +42,7 @@ public class SourceIdAllocator {
|
||||
}
|
||||
|
||||
List<Integer> allocatedIDs = mockRace.getRaceDataSource().getParticipants();
|
||||
|
||||
List<Integer> allIDs = new ArrayList<>(mockRace.getBoatDataSource().getBoats().keySet());
|
||||
|
||||
//Get list of unallocated ids.
|
||||
|
||||
@@ -187,7 +187,7 @@ public class RaceXMLCreator {
|
||||
public static void setRaceXMLAtCurrentTimeToNow(XMLRace raceXML) {
|
||||
|
||||
//The start time is current time + 4 minutes. prestart is 3 minutes, and we add another minute.
|
||||
long millisecondsToAdd = Constants.RacePreStartTime + (1 * 60 * 1000);
|
||||
long millisecondsToAdd = Constants.RacePreStartTime + Constants.RacePreparatoryTime;
|
||||
long secondsToAdd = millisecondsToAdd / 1000;
|
||||
//Scale the time using our time scalar.
|
||||
secondsToAdd = secondsToAdd / Constants.RaceTimeScale;
|
||||
|
||||
Reference in New Issue
Block a user