summaryrefslogtreecommitdiff
path: root/src/main/java/org/luxons/sevenwonders
diff options
context:
space:
mode:
authorjbion <joffrey.bion@amadeus.com>2016-12-23 01:07:34 +0100
committerjbion <joffrey.bion@amadeus.com>2016-12-23 01:07:55 +0100
commitdb97cbd251f2af0b996da9d2492736f150cb07fe (patch)
tree51be5d8281b0156fcf0bc102d99d0745a8b64492 /src/main/java/org/luxons/sevenwonders
parentAdd brush test for game definition loading to ensure no exception occur (diff)
downloadseven-wonders-db97cbd251f2af0b996da9d2492736f150cb07fe.tar.gz
seven-wonders-db97cbd251f2af0b996da9d2492736f150cb07fe.tar.bz2
seven-wonders-db97cbd251f2af0b996da9d2492736f150cb07fe.zip
Suppress warnings for fields that are injected by Gson
Diffstat (limited to 'src/main/java/org/luxons/sevenwonders')
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/data/definitions/CardDefinition.java1
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/data/definitions/DecksDefinition.java1
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/data/definitions/EffectsDefinition.java1
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderDefinition.java25
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderSide.java2
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderSideDefinition.java30
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderStageDefinition.java1
7 files changed, 36 insertions, 25 deletions
diff --git a/src/main/java/org/luxons/sevenwonders/game/data/definitions/CardDefinition.java b/src/main/java/org/luxons/sevenwonders/game/data/definitions/CardDefinition.java
index f469ca4f..621bed2c 100644
--- a/src/main/java/org/luxons/sevenwonders/game/data/definitions/CardDefinition.java
+++ b/src/main/java/org/luxons/sevenwonders/game/data/definitions/CardDefinition.java
@@ -8,6 +8,7 @@ import org.luxons.sevenwonders.game.cards.Card;
import org.luxons.sevenwonders.game.cards.Color;
import org.luxons.sevenwonders.game.cards.Requirements;
+@SuppressWarnings("unused") // the fields are injected by Gson
public class CardDefinition implements Definition<Card> {
private String name;
diff --git a/src/main/java/org/luxons/sevenwonders/game/data/definitions/DecksDefinition.java b/src/main/java/org/luxons/sevenwonders/game/data/definitions/DecksDefinition.java
index c95977f2..6f97e55f 100644
--- a/src/main/java/org/luxons/sevenwonders/game/data/definitions/DecksDefinition.java
+++ b/src/main/java/org/luxons/sevenwonders/game/data/definitions/DecksDefinition.java
@@ -12,6 +12,7 @@ import org.luxons.sevenwonders.game.cards.Card;
import org.luxons.sevenwonders.game.cards.CardBack;
import org.luxons.sevenwonders.game.cards.Decks;
+@SuppressWarnings("unused,MismatchedQueryAndUpdateOfCollection") // the fields are injected by Gson
public class DecksDefinition implements Definition<Decks> {
private List<CardDefinition> age1;
diff --git a/src/main/java/org/luxons/sevenwonders/game/data/definitions/EffectsDefinition.java b/src/main/java/org/luxons/sevenwonders/game/data/definitions/EffectsDefinition.java
index d239318d..836fecc6 100644
--- a/src/main/java/org/luxons/sevenwonders/game/data/definitions/EffectsDefinition.java
+++ b/src/main/java/org/luxons/sevenwonders/game/data/definitions/EffectsDefinition.java
@@ -15,6 +15,7 @@ import org.luxons.sevenwonders.game.effects.ScienceProgress;
import org.luxons.sevenwonders.game.effects.SpecialAction;
import org.luxons.sevenwonders.game.effects.SpecialActionTrigger;
+@SuppressWarnings("unused") // the fields are injected by Gson
public class EffectsDefinition implements Definition<List<Effect>> {
private GoldIncrease gold;
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 2dfe7bb7..d44cccff 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
@@ -1,14 +1,11 @@
package org.luxons.sevenwonders.game.data.definitions;
-import java.util.List;
import java.util.Map;
-import java.util.stream.Collectors;
import org.luxons.sevenwonders.game.Settings;
-import org.luxons.sevenwonders.game.resources.ResourceType;
import org.luxons.sevenwonders.game.wonders.Wonder;
-import org.luxons.sevenwonders.game.wonders.WonderStage;
+@SuppressWarnings("unused,MismatchedQueryAndUpdateOfCollection") // the fields are injected by Gson
public class WonderDefinition implements Definition<Wonder> {
private String name;
@@ -27,24 +24,4 @@ public class WonderDefinition implements Definition<Wonder> {
return wonder;
}
- public static class WonderSideDefinition {
-
- private ResourceType initialResource;
-
- private List<WonderStageDefinition> stages;
-
- private String image;
-
- ResourceType getInitialResource() {
- return initialResource;
- }
-
- List<WonderStage> createStages(Settings settings) {
- return stages.stream().map(def -> def.create(settings)).collect(Collectors.toList());
- }
-
- String getImage() {
- return image;
- }
- }
}
diff --git a/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderSide.java b/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderSide.java
index 9cfeb767..08c85f57 100644
--- a/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderSide.java
+++ b/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderSide.java
@@ -1,5 +1,5 @@
package org.luxons.sevenwonders.game.data.definitions;
public enum WonderSide {
- A, B;
+ A, B
}
diff --git a/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderSideDefinition.java b/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderSideDefinition.java
new file mode 100644
index 00000000..9b2bc2d5
--- /dev/null
+++ b/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderSideDefinition.java
@@ -0,0 +1,30 @@
+package org.luxons.sevenwonders.game.data.definitions;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.luxons.sevenwonders.game.Settings;
+import org.luxons.sevenwonders.game.resources.ResourceType;
+import org.luxons.sevenwonders.game.wonders.WonderStage;
+
+@SuppressWarnings("unused,MismatchedQueryAndUpdateOfCollection") // the fields are injected by Gson
+class WonderSideDefinition {
+
+ private ResourceType initialResource;
+
+ private List<WonderStageDefinition> stages;
+
+ private String image;
+
+ ResourceType getInitialResource() {
+ return initialResource;
+ }
+
+ List<WonderStage> createStages(Settings settings) {
+ return stages.stream().map(def -> def.create(settings)).collect(Collectors.toList());
+ }
+
+ String getImage() {
+ return image;
+ }
+}
diff --git a/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderStageDefinition.java b/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderStageDefinition.java
index 7a866e05..887b414a 100644
--- a/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderStageDefinition.java
+++ b/src/main/java/org/luxons/sevenwonders/game/data/definitions/WonderStageDefinition.java
@@ -4,6 +4,7 @@ import org.luxons.sevenwonders.game.Settings;
import org.luxons.sevenwonders.game.cards.Requirements;
import org.luxons.sevenwonders.game.wonders.WonderStage;
+@SuppressWarnings("unused") // the fields are injected by Gson
public class WonderStageDefinition implements Definition<WonderStage> {
private Requirements requirements;
bgstack15