diff options
author | Joffrey Bion <joffrey.bion@amadeus.com> | 2018-04-24 08:28:11 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@amadeus.com> | 2018-04-24 08:28:11 +0200 |
commit | f2a505ae9f6ea4b6a4dad5a6fdd83498138e5517 (patch) | |
tree | 775d877f069078612836230635e1fbeb3cf912c0 | |
parent | Extract game engine as separate artifact (diff) | |
download | seven-wonders-f2a505ae9f6ea4b6a4dad5a6fdd83498138e5517.tar.gz seven-wonders-f2a505ae9f6ea4b6a4dad5a6fdd83498138e5517.tar.bz2 seven-wonders-f2a505ae9f6ea4b6a4dad5a6fdd83498138e5517.zip |
Extract inner class to work around coverage bug
-rw-r--r-- | game-engine/src/main/java/org/luxons/sevenwonders/game/resources/BestPriceCalculator.java | 25 | ||||
-rw-r--r-- | game-engine/src/main/java/org/luxons/sevenwonders/game/resources/ResourcePool.java | 29 |
2 files changed, 29 insertions, 25 deletions
diff --git a/game-engine/src/main/java/org/luxons/sevenwonders/game/resources/BestPriceCalculator.java b/game-engine/src/main/java/org/luxons/sevenwonders/game/resources/BestPriceCalculator.java index 8fed41d1..0cae3fe2 100644 --- a/game-engine/src/main/java/org/luxons/sevenwonders/game/resources/BestPriceCalculator.java +++ b/game-engine/src/main/java/org/luxons/sevenwonders/game/resources/BestPriceCalculator.java @@ -73,30 +73,5 @@ public class BestPriceCalculator { return currentMinPrice; } - private static class ResourcePool { - - private final Set<Set<ResourceType>> choices; - - private final Provider provider; - - private final TradingRules rules; - - private ResourcePool(Production production, Provider provider, TradingRules rules) { - this.choices = production.asChoices(); - this.provider = provider; - this.rules = rules; - } - - Set<Set<ResourceType>> getChoices() { - return choices; - } - - int getCost(ResourceType type) { - if (provider == null) { - return 0; - } - return rules.getCost(type, provider); - } - } } diff --git a/game-engine/src/main/java/org/luxons/sevenwonders/game/resources/ResourcePool.java b/game-engine/src/main/java/org/luxons/sevenwonders/game/resources/ResourcePool.java new file mode 100644 index 00000000..ad368066 --- /dev/null +++ b/game-engine/src/main/java/org/luxons/sevenwonders/game/resources/ResourcePool.java @@ -0,0 +1,29 @@ +package org.luxons.sevenwonders.game.resources; + +import java.util.Set; + +class ResourcePool { + + private final Set<Set<ResourceType>> choices; + + private final Provider provider; + + private final TradingRules rules; + + ResourcePool(Production production, Provider provider, TradingRules rules) { + this.choices = production.asChoices(); + this.provider = provider; + this.rules = rules; + } + + Set<Set<ResourceType>> getChoices() { + return choices; + } + + int getCost(ResourceType type) { + if (provider == null) { + return 0; + } + return rules.getCost(type, provider); + } +} |