Created a random place token generator.

Generates a location between any leg of the race in a random angle / distance of the radius of the centre point of the two gates to one of the gates

#story[1293]
This commit is contained in:
William Muir
2017-09-27 01:44:01 +13:00
parent 330ccd272d
commit 6d51ea3574
4 changed files with 97 additions and 41 deletions
@@ -15,11 +15,24 @@ public class Token extends GeoPoint {
private TokenType tokenType;
private Random random = new Random();
//Constructor for creating a specific type client side
public Token(TokenType tokenType, double lat, double lng) {
super(lat, lng);
this.tokenType = tokenType;
}
//Making random type server side
public Token(double lat, double lng) {
super(lat, lng);
assignRandomType();
}
//Making random type server side
public Token(GeoPoint geoPoint) {
super(geoPoint.getLat(), geoPoint.getLng());
assignRandomType();
}
public TokenType getTokenType() {
return tokenType;
}