summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorjbion <joffrey.bion@amadeus.com>2016-12-21 22:33:10 +0100
committerjbion <joffrey.bion@amadeus.com>2016-12-21 22:33:10 +0100
commit306ef2c638bf6b59c47c4b3e7be43c4046f4a352 (patch)
tree010c39361bd76b6ea0cd6c1f85daf4d220a23a6f /src/main/java
parentFix number of Guild cards used in Decks (diff)
downloadseven-wonders-306ef2c638bf6b59c47c4b3e7be43c4046f4a352.tar.gz
seven-wonders-306ef2c638bf6b59c47c4b3e7be43c4046f4a352.tar.bz2
seven-wonders-306ef2c638bf6b59c47c4b3e7be43c4046f4a352.zip
Remove unused "nb of guild cards" setting
Diffstat (limited to 'src/main/java')
-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