mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user