mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Merge remote-tracking branch 'origin/story1266_3d_model_factory' into NewUI_merge
# Conflicts: # pom.xml # src/main/java/seng302/App.java # src/main/java/seng302/gameServer/GameState.java # src/main/java/seng302/gameServer/MainServerThread.java # src/main/java/seng302/gameServer/ServerToClientThread.java # src/main/java/seng302/utilities/XMLGenerator.java # src/main/java/seng302/visualiser/GameClient.java # src/main/java/seng302/visualiser/controllers/RaceViewController.java # src/main/resources/views/RaceView.fxml # src/main/resources/views/StartScreenView.fxml
This commit is contained in:
+15
-11
@@ -5,28 +5,23 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import seng302.model.ServerYacht;
|
||||
import seng302.model.token.Token;
|
||||
|
||||
/**
|
||||
* A Race object that can be parsed into XML
|
||||
*/
|
||||
public class Race {
|
||||
public class RaceXMLTemplate {
|
||||
|
||||
private List<ServerYacht> yachts;
|
||||
private LocalDateTime startTime;
|
||||
private List<Token> tokens;
|
||||
|
||||
public Race(){
|
||||
yachts = new ArrayList<>();
|
||||
public RaceXMLTemplate(List<ServerYacht> yachts, List<Token> tokens) {
|
||||
this.yachts = yachts;
|
||||
this.tokens = tokens;
|
||||
startTime = LocalDateTime.now();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a boat to the race
|
||||
* @param yacht The boat to add
|
||||
*/
|
||||
public void addBoat(ServerYacht yacht) {
|
||||
yachts.add(yacht);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of boats in the race
|
||||
* @return A List of boats
|
||||
@@ -35,6 +30,15 @@ public class Race {
|
||||
return Collections.unmodifiableList(yachts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of tokens in the race
|
||||
*
|
||||
* @return A list of tokens
|
||||
*/
|
||||
public List<Token> getTokens() {
|
||||
return Collections.unmodifiableList(tokens);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the time until the race starts
|
||||
* @param seconds The time in seconds until the race starts
|
||||
+2
-2
@@ -3,7 +3,7 @@ package seng302.model.stream.xml.generator;
|
||||
/**
|
||||
* A Race regatta that can be parsed into XML
|
||||
*/
|
||||
public class Regatta {
|
||||
public class RegattaXMLTemplate {
|
||||
private final Double DEFAULT_ALTITUDE = 0d;
|
||||
private final Integer DEFAULT_REGATTA_ID = 0;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class Regatta {
|
||||
private Integer utcOffset;
|
||||
private Double magneticVariation;
|
||||
|
||||
public Regatta(String name, String courseName, Double latitude, Double longitude) {
|
||||
public RegattaXMLTemplate(String name, String courseName, Double latitude, Double longitude) {
|
||||
this.name = name;
|
||||
this.id = DEFAULT_REGATTA_ID;
|
||||
this.courseName = courseName;
|
||||
@@ -6,6 +6,7 @@ import java.util.Map;
|
||||
import seng302.model.Limit;
|
||||
import seng302.model.mark.CompoundMark;
|
||||
import seng302.model.mark.Corner;
|
||||
import seng302.model.token.Token;
|
||||
|
||||
/**
|
||||
* Process a Document object containing race data in XML format and stores the data.
|
||||
@@ -13,13 +14,16 @@ import seng302.model.mark.Corner;
|
||||
public class RaceXMLData {
|
||||
|
||||
private List<Integer> participants;
|
||||
private List<Token> tokens;
|
||||
private Map<Integer, CompoundMark> compoundMarks;
|
||||
private List<Corner> markSequence;
|
||||
private List<Limit> courseLimit;
|
||||
|
||||
public RaceXMLData(List<Integer> participants, List<CompoundMark> compoundMarks,
|
||||
public RaceXMLData(List<Integer> participants, List<Token> tokens,
|
||||
List<CompoundMark> compoundMarks,
|
||||
List<Corner> markSequence, List<Limit> courseLimit) {
|
||||
this.participants = participants;
|
||||
this.tokens = tokens;
|
||||
this.markSequence = markSequence;
|
||||
this.courseLimit = courseLimit;
|
||||
this.compoundMarks = new HashMap<>();
|
||||
@@ -32,6 +36,10 @@ public class RaceXMLData {
|
||||
return participants;
|
||||
}
|
||||
|
||||
public List<Token> getTokens() {
|
||||
return tokens;
|
||||
}
|
||||
|
||||
public Map<Integer, CompoundMark> getCompoundMarks() {
|
||||
return compoundMarks;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user