diff options
Diffstat (limited to 'src/main')
4 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/luxons/sevenwonders/game/cards/Card.java b/src/main/java/org/luxons/sevenwonders/game/cards/Card.java index 5c79ac32..9840e260 100644 --- a/src/main/java/org/luxons/sevenwonders/game/cards/Card.java +++ b/src/main/java/org/luxons/sevenwonders/game/cards/Card.java @@ -39,6 +39,8 @@ public class Card { } public void play(Board board, Board leftNeighbourBoard, Board rightNeighbourBoard) { + // adding the card must be done first, as some effects count the number of cards + // FIXME this is actually broken as ALL cards in the turn need to be added to the board before any effect board.addCard(this); requirements.pay(board); effects.forEach(e -> e.apply(board, leftNeighbourBoard, rightNeighbourBoard)); diff --git a/src/main/java/org/luxons/sevenwonders/game/effects/Effect.java b/src/main/java/org/luxons/sevenwonders/game/effects/Effect.java index b9634553..1d2189a2 100644 --- a/src/main/java/org/luxons/sevenwonders/game/effects/Effect.java +++ b/src/main/java/org/luxons/sevenwonders/game/effects/Effect.java @@ -2,6 +2,11 @@ package org.luxons.sevenwonders.game.effects; import org.luxons.sevenwonders.game.boards.Board; +/** + * Represents an effect than can be applied to a player's board when playing a card or building his wonder. The effect + * may affect (or depend on) the adjacent boards. It can have an instantaneous effect on the board, or be postponed to + * the end of game where point calculations take place. + */ public interface Effect { void apply(Board board, Board leftNeighbourBoard, Board rightNeighbourBoard); diff --git a/src/main/java/org/luxons/sevenwonders/game/effects/EndGameEffect.java b/src/main/java/org/luxons/sevenwonders/game/effects/EndGameEffect.java index ca8a1948..c2edc99b 100644 --- a/src/main/java/org/luxons/sevenwonders/game/effects/EndGameEffect.java +++ b/src/main/java/org/luxons/sevenwonders/game/effects/EndGameEffect.java @@ -6,5 +6,6 @@ public abstract class EndGameEffect implements Effect { @Override public void apply(Board board, Board leftNeighbourBoard, Board rightNeighbourBoard) { + // EndGameEffects don't do anything when applied to the board, they simply give more points in the end } } diff --git a/src/main/java/org/luxons/sevenwonders/game/effects/InstantEffect.java b/src/main/java/org/luxons/sevenwonders/game/effects/InstantEffect.java index c3e5455e..e6e5aced 100644 --- a/src/main/java/org/luxons/sevenwonders/game/effects/InstantEffect.java +++ b/src/main/java/org/luxons/sevenwonders/game/effects/InstantEffect.java @@ -6,6 +6,7 @@ public abstract class InstantEffect implements Effect { @Override public int computePoints(Board board, Board leftNeighbourBoard, Board rightNeighbourBoard) { + // InstantEffects are only important when applied to the board, they don't give extra points in the end return 0; } } |