Refactored some of the XMLGenerator code. Added tokens to the generated XML

Refactor not complete. Generation needs some tidying.

#story[1250]
This commit is contained in:
William Muir
2017-08-29 14:56:06 +12:00
parent 2fcff65dd6
commit c15f13bc2c
10 changed files with 128 additions and 62 deletions
@@ -29,6 +29,7 @@ import seng302.model.ServerYacht;
import seng302.model.mark.CompoundMark;
import seng302.model.mark.Mark;
import seng302.model.mark.MarkOrder;
import seng302.model.token.Token;
import seng302.utilities.GeoUtility;
import seng302.utilities.XMLParser;
@@ -65,6 +66,7 @@ public class GameState implements Runnable {
private static String hostIpAddress;
private static List<Player> players;
private static Map<Integer, ServerYacht> yachts;
private static List<Token> tokens;
private static Boolean isRaceStarted;
private static GameStages currentStage;
private static MarkOrder markOrder;
@@ -91,6 +93,7 @@ public class GameState implements Runnable {
windSpeed = 10000d;
this.hostIpAddress = hostIpAddress;
yachts = new HashMap<>();
tokens = new ArrayList<>();
players = new ArrayList<>();
GameState.hostIpAddress = hostIpAddress;
customizationFlag = false;
@@ -137,6 +140,10 @@ public class GameState implements Runnable {
return players;
}
public static List<Token> getTokens() {
return tokens;
}
public static void addPlayer(Player player) {
players.add(player);
String playerText = player.getYacht().getSourceId() + " " + player.getYacht().getBoatName()