mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Updated the icons to be more uniform and transparent
#story[1293]
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package seng302.gameServer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -26,8 +24,6 @@ import seng302.gameServer.messages.MarkRoundingMessage;
|
||||
import seng302.gameServer.messages.MarkType;
|
||||
import seng302.gameServer.messages.Message;
|
||||
import seng302.gameServer.messages.RoundingBoatStatus;
|
||||
import seng302.gameServer.messages.YachtEventCodeMessage;
|
||||
import seng302.gameServer.messages.YachtEventType;
|
||||
import seng302.model.GeoPoint;
|
||||
import seng302.model.Limit;
|
||||
import seng302.model.Player;
|
||||
@@ -359,8 +355,8 @@ public class GameState implements Runnable {
|
||||
*/
|
||||
private void spawnNewToken() {
|
||||
tokensInPlay.clear();
|
||||
Token token = randomSpawn.getRandomTokenLocation();
|
||||
// token.assignType(TokenType.WIND_WALKER);
|
||||
Token token = randomSpawn.getRandomToken();
|
||||
// token.assignType(TokenType.RANDOM);
|
||||
logger.debug("Spawned token of type " + token.getTokenType());
|
||||
tokensInPlay.add(token);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public class RandomSpawn {
|
||||
private static final Integer DEGREES_IN_CIRCLE = 360;
|
||||
|
||||
private HashMap<GeoPoint, Double> spawnRadii;
|
||||
private Object[] spawnCentres;
|
||||
private Random random;
|
||||
|
||||
/**
|
||||
@@ -27,6 +28,7 @@ public class RandomSpawn {
|
||||
random = new Random();
|
||||
|
||||
spawnRadii = generateSpawnRadii(markOrder);
|
||||
spawnCentres = spawnRadii.keySet().toArray();
|
||||
}
|
||||
|
||||
private HashMap<GeoPoint, Double> generateSpawnRadii(List<CompoundMark> markOrder) {
|
||||
@@ -48,9 +50,8 @@ public class RandomSpawn {
|
||||
* @return A random token type at a random location in a random radii of the set of possible
|
||||
* radii
|
||||
*/
|
||||
public Token getRandomTokenLocation() {
|
||||
Object[] keys = spawnRadii.keySet().toArray();
|
||||
GeoPoint randomSpawnCentre = (GeoPoint) keys[random.nextInt(keys.length)];
|
||||
public Token getRandomToken() {
|
||||
GeoPoint randomSpawnCentre = (GeoPoint) spawnCentres[random.nextInt(spawnCentres.length)];
|
||||
Double spawnRadius = spawnRadii.get(randomSpawnCentre);
|
||||
Double randomDistance = spawnRadius * random.nextDouble();
|
||||
Double randomAngle = random.nextDouble() * DEGREES_IN_CIRCLE;
|
||||
|
||||
Reference in New Issue
Block a user