summaryrefslogtreecommitdiff
path: root/src/main/java/org/luxons/sevenwonders
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2016-12-10 19:21:19 +0100
committerJoffrey BION <joffrey.bion@gmail.com>2016-12-10 19:21:19 +0100
commitf1592d3f88cbb4729f5c450146175b28d24542b0 (patch)
tree7916fd88dd0ec486427f44b5b1163c8c29a2e90d /src/main/java/org/luxons/sevenwonders
parentAdd BoardTest (diff)
downloadseven-wonders-f1592d3f88cbb4729f5c450146175b28d24542b0.tar.gz
seven-wonders-f1592d3f88cbb4729f5c450146175b28d24542b0.tar.bz2
seven-wonders-f1592d3f88cbb4729f5c450146175b28d24542b0.zip
Add special action skeleton to finish wonders data parsing
These special actions imply a new input from the user, which is not implemented yet
Diffstat (limited to 'src/main/java/org/luxons/sevenwonders')
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/data/definitions/EffectsDefinition.java7
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/effects/SpecialAction.java25
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/effects/SpecialActionTrigger.java26
3 files changed, 58 insertions, 0 deletions
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 f7fe5573..d239318d 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
@@ -12,6 +12,8 @@ import org.luxons.sevenwonders.game.effects.MilitaryReinforcements;
import org.luxons.sevenwonders.game.effects.ProductionIncrease;
import org.luxons.sevenwonders.game.effects.RawPointsIncrease;
import org.luxons.sevenwonders.game.effects.ScienceProgress;
+import org.luxons.sevenwonders.game.effects.SpecialAction;
+import org.luxons.sevenwonders.game.effects.SpecialActionTrigger;
public class EffectsDefinition implements Definition<List<Effect>> {
@@ -29,6 +31,8 @@ public class EffectsDefinition implements Definition<List<Effect>> {
private RawPointsIncrease points;
+ private SpecialAction action;
+
@Override
public List<Effect> create(Settings settings) {
List<Effect> effects = new ArrayList<>();
@@ -53,6 +57,9 @@ public class EffectsDefinition implements Definition<List<Effect>> {
if (points != null) {
effects.add(points);
}
+ if (action != null) {
+ effects.add(new SpecialActionTrigger(action));
+ }
return effects;
}
}
diff --git a/src/main/java/org/luxons/sevenwonders/game/effects/SpecialAction.java b/src/main/java/org/luxons/sevenwonders/game/effects/SpecialAction.java
new file mode 100644
index 00000000..83cc1956
--- /dev/null
+++ b/src/main/java/org/luxons/sevenwonders/game/effects/SpecialAction.java
@@ -0,0 +1,25 @@
+package org.luxons.sevenwonders.game.effects;
+
+public enum SpecialAction {
+ /**
+ * The player can play the last card of each age instead of discarding it. This card can be played by paying its
+ * cost, discarded to gain 3 coins or used in the construction of his or her Wonder.
+ */
+ PLAY_LAST_CARD,
+
+ /**
+ * Once per age, a player can construct a building from his or her hand for free.
+ */
+ ONE_FREE,
+
+ /**
+ * The player can look at all cards discarded since the beginning of the game, pick one and build it for free.
+ */
+ PLAY_DISCARDED,
+
+ /**
+ * The player can, at the end of the game, “copy” a Guild of his or her choice (purple card), built by one of his or
+ * her two neighboring cities.
+ */
+ COPY_GUILD;
+}
diff --git a/src/main/java/org/luxons/sevenwonders/game/effects/SpecialActionTrigger.java b/src/main/java/org/luxons/sevenwonders/game/effects/SpecialActionTrigger.java
new file mode 100644
index 00000000..aef06741
--- /dev/null
+++ b/src/main/java/org/luxons/sevenwonders/game/effects/SpecialActionTrigger.java
@@ -0,0 +1,26 @@
+package org.luxons.sevenwonders.game.effects;
+
+import org.luxons.sevenwonders.game.boards.Board;
+
+public class SpecialActionTrigger implements Effect {
+
+ private final SpecialAction specialAction;
+
+ public SpecialActionTrigger(SpecialAction specialAction) {
+ this.specialAction = specialAction;
+ }
+
+ public SpecialAction getSpecialAction() {
+ return specialAction;
+ }
+
+ @Override
+ public void apply(Board board, Board leftNeighbourBoard, Board rightNeighbourBoard) {
+
+ }
+
+ @Override
+ public int computePoints(Board board, Board leftNeighbourBoard, Board rightNeighbourBoard) {
+ return 0;
+ }
+}
bgstack15