Sample Tokens are now sent out in RaceXML correctly

Token and TokenType class created

#story[1250]
This commit is contained in:
William Muir
2017-08-29 15:37:01 +12:00
parent c15f13bc2c
commit 23027705da
2 changed files with 17 additions and 1 deletions
@@ -30,6 +30,7 @@ import seng302.model.mark.CompoundMark;
import seng302.model.mark.Mark; import seng302.model.mark.Mark;
import seng302.model.mark.MarkOrder; import seng302.model.mark.MarkOrder;
import seng302.model.token.Token; import seng302.model.token.Token;
import seng302.model.token.TokenType;
import seng302.utilities.GeoUtility; import seng302.utilities.GeoUtility;
import seng302.utilities.XMLParser; import seng302.utilities.XMLParser;
@@ -94,6 +95,17 @@ public class GameState implements Runnable {
this.hostIpAddress = hostIpAddress; this.hostIpAddress = hostIpAddress;
yachts = new HashMap<>(); yachts = new HashMap<>();
tokens = new ArrayList<>(); tokens = new ArrayList<>();
//TEMP TEST STUFF
// TODO: 29/08/17 wmu16 - Take this out!
tokens.add(new Token(TokenType.BOOST, 1233d, 11.83154));
tokens.add(new Token(TokenType.BOOST, 57.66877, 11.83382));
tokens.add(new Token(TokenType.BOOST, 57.66914, 11.83965));
tokens.add(new Token(TokenType.BOOST, 57.66684, 11.83214));
;
//TEMP TEST STUFF
players = new ArrayList<>(); players = new ArrayList<>();
GameState.hostIpAddress = hostIpAddress; GameState.hostIpAddress = hostIpAddress;
customizationFlag = false; customizationFlag = false;
@@ -140,6 +152,10 @@ public class GameState implements Runnable {
return players; return players;
} }
public static void addToken(Token token) {
tokens.add(token);
}
public static List<Token> getTokens() { public static List<Token> getTokens() {
return tokens; return tokens;
} }
@@ -13,7 +13,7 @@
<Tokens> <Tokens>
<#list tokens as token> <#list tokens as token>
<Token TokenType="${token.type}" TargetLat="${token.targetLat}" TargetLng="${token.targetLng}"/> <Token TokenType="${token.tokenType}" TargetLat="${token.lat?c}" TargetLng="${token.lng?c}"/>
</#list> </#list>
</Tokens> </Tokens>