summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/Settings.java15
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/data/GameDefinition.java4
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.java14
3 files changed, 11 insertions, 22 deletions
diff --git a/src/main/java/org/luxons/sevenwonders/game/Settings.java b/src/main/java/org/luxons/sevenwonders/game/Settings.java
index e733b460..b3ee2232 100644
--- a/src/main/java/org/luxons/sevenwonders/game/Settings.java
+++ b/src/main/java/org/luxons/sevenwonders/game/Settings.java
@@ -16,10 +16,7 @@ public class Settings {
private WonderSide wonderSide = WonderSide.A;
- // will default to nbPlayers + 2
- private Integer nbGuildCards = null;
-
- private long randomSeedForTests = 0;
+ private long randomSeedForTests = -1;
public int getNbPlayers() {
if (nbPlayers < 0) {
@@ -64,14 +61,6 @@ public class Settings {
this.wonderSide = wonderSide;
}
- public int getNbGuildCards() {
- return nbGuildCards == null ? getNbPlayers() + 2 : nbGuildCards;
- }
-
- public void setNbGuildCards(int nbGuildCards) {
- this.nbGuildCards = nbGuildCards;
- }
-
public long getRandomSeedForTests() {
return randomSeedForTests;
}
@@ -81,6 +70,6 @@ public class Settings {
}
public Random getRandom() {
- return new Random(randomSeedForTests);
+ return randomSeedForTests > 0 ? new Random(randomSeedForTests) : new Random();
}
}
diff --git a/src/main/java/org/luxons/sevenwonders/game/data/GameDefinition.java b/src/main/java/org/luxons/sevenwonders/game/data/GameDefinition.java
index 801b7559..a14411bd 100644
--- a/src/main/java/org/luxons/sevenwonders/game/data/GameDefinition.java
+++ b/src/main/java/org/luxons/sevenwonders/game/data/GameDefinition.java
@@ -42,10 +42,10 @@ public class GameDefinition {
return MAX_PLAYERS;
}
- public Game initGame(long id, Settings settings, List<Player> players) {
+ public Game initGame(long id, Settings settings, List<Player> orderedPlayers) {
List<Board> boards = pickRandomBoards(settings);
Decks decks = decksDefinition.create(settings);
- return new Game(id, settings, players, boards, decks);
+ return new Game(id, settings, orderedPlayers, boards, decks);
}
private List<Board> pickRandomBoards(Settings settings) {
diff --git a/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.java b/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.java
index 89a58db0..576f2bc2 100644
--- a/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.java
+++ b/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.java
@@ -10,11 +10,11 @@ import org.luxons.sevenwonders.game.wonders.WonderLevel;
public class WonderDefinition implements Definition<Wonder> {
- public String name;
+ private String name;
- public WonderSideDefinition a;
+ private WonderSideDefinition a;
- public WonderSideDefinition b;
+ private WonderSideDefinition b;
@Override
public Wonder create(Settings settings) {
@@ -44,17 +44,17 @@ public class WonderDefinition implements Definition<Wonder> {
private List<WonderLevelDefinition> stages;
- public String image;
+ private String image;
- public ResourceType getInitialResource() {
+ ResourceType getInitialResource() {
return initialResource;
}
- public List<WonderLevel> createStages(Settings settings) {
+ List<WonderLevel> createStages(Settings settings) {
return stages.stream().map(def -> def.create(settings)).collect(Collectors.toList());
}
- public String getImage() {
+ String getImage() {
return image;
}
}
bgstack15