summaryrefslogtreecommitdiff
path: root/game-engine/src
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@amadeus.com>2018-04-24 08:28:11 +0200
committerJoffrey Bion <joffrey.bion@amadeus.com>2018-04-24 08:28:11 +0200
commitf2a505ae9f6ea4b6a4dad5a6fdd83498138e5517 (patch)
tree775d877f069078612836230635e1fbeb3cf912c0 /game-engine/src
parentExtract game engine as separate artifact (diff)
downloadseven-wonders-f2a505ae9f6ea4b6a4dad5a6fdd83498138e5517.tar.gz
seven-wonders-f2a505ae9f6ea4b6a4dad5a6fdd83498138e5517.tar.bz2
seven-wonders-f2a505ae9f6ea4b6a4dad5a6fdd83498138e5517.zip
Extract inner class to work around coverage bug
Diffstat (limited to 'game-engine/src')
-rw-r--r--game-engine/src/main/java/org/luxons/sevenwonders/game/resources/BestPriceCalculator.java25
-rw-r--r--game-engine/src/main/java/org/luxons/sevenwonders/game/resources/ResourcePool.java29
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);
+ }
+}
bgstack15