diff options
author | Joffrey Bion <joffrey.bion@amadeus.com> | 2018-04-25 17:48:13 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@amadeus.com> | 2018-04-25 17:48:13 +0200 |
commit | 0b349b3272e49a5feb261be99c9f9bd3863384e6 (patch) | |
tree | 7f74111fe36cb9387ece40bc449b046aea4dc8a1 /game-engine/src/main/java | |
parent | Add test for BuildWonderMove (diff) | |
download | seven-wonders-0b349b3272e49a5feb261be99c9f9bd3863384e6.tar.gz seven-wonders-0b349b3272e49a5feb261be99c9f9bd3863384e6.tar.bz2 seven-wonders-0b349b3272e49a5feb261be99c9f9bd3863384e6.zip |
Fix WonderStage creation to add at least an empty effect list
Diffstat (limited to 'game-engine/src/main/java')
2 files changed, 8 insertions, 14 deletions
diff --git a/game-engine/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderStageDefinition.java b/game-engine/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderStageDefinition.java index 887b414a..230484ee 100644 --- a/game-engine/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderStageDefinition.java +++ b/game-engine/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderStageDefinition.java @@ -13,9 +13,6 @@ public class WonderStageDefinition implements Definition<WonderStage> { @Override public WonderStage create(Settings settings) { - WonderStage stage = new WonderStage(); - stage.setRequirements(requirements); - stage.setEffects(effects.create(settings)); - return stage; + return new WonderStage(requirements, effects.create(settings)); } } diff --git a/game-engine/src/main/java/org/luxons/sevenwonders/game/wonders/WonderStage.java b/game-engine/src/main/java/org/luxons/sevenwonders/game/wonders/WonderStage.java index 5f6765ee..89b20383 100644 --- a/game-engine/src/main/java/org/luxons/sevenwonders/game/wonders/WonderStage.java +++ b/game-engine/src/main/java/org/luxons/sevenwonders/game/wonders/WonderStage.java @@ -11,28 +11,25 @@ import org.luxons.sevenwonders.game.resources.BoughtResources; public class WonderStage { - private Requirements requirements; + private final Requirements requirements; - private List<Effect> effects; + private final List<Effect> effects; private CardBack cardBack; - public Requirements getRequirements() { - return requirements; + public WonderStage(Requirements requirements, List<Effect> effects) { + this.requirements = requirements; + this.effects = effects; } - public void setRequirements(Requirements requirements) { - this.requirements = requirements; + public Requirements getRequirements() { + return requirements; } public List<Effect> getEffects() { return effects; } - public void setEffects(List<Effect> effects) { - this.effects = effects; - } - public CardBack getCardBack() { return cardBack; } |