diff options
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/luxons/sevenwonders/game/boards/Board.java | 4 | ||||
-rw-r--r-- | src/main/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElement.java | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/org/luxons/sevenwonders/game/boards/Board.java b/src/main/java/org/luxons/sevenwonders/game/boards/Board.java index c327ed72..b405a566 100644 --- a/src/main/java/org/luxons/sevenwonders/game/boards/Board.java +++ b/src/main/java/org/luxons/sevenwonders/game/boards/Board.java @@ -49,8 +49,8 @@ public class Board { playedCards.add(card); } - public int getNbCardsOfColor(Color color) { - return (int) playedCards.stream().filter(c -> c.getColor() == color).count(); + public int getNbCardsOfColor(List<Color> colorFilter) { + return (int) playedCards.stream().filter(c -> colorFilter.contains(c.getColor())).count(); } public Production getProduction() { diff --git a/src/main/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElement.java b/src/main/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElement.java index f876328c..57b83054 100644 --- a/src/main/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElement.java +++ b/src/main/java/org/luxons/sevenwonders/game/effects/BonusPerBoardElement.java @@ -17,7 +17,7 @@ public class BonusPerBoardElement implements Effect { private BoardElementType type; // only relevant if type=CARD - private Color color; + private List<Color> colors; public List<RelativePlayerPosition> getBoards() { return boards; @@ -51,12 +51,12 @@ public class BonusPerBoardElement implements Effect { this.type = type; } - public Color getColor() { - return color; + public List<Color> getColors() { + return colors; } - public void setColor(Color color) { - this.color = color; + public void setColors(List<Color> colors) { + this.colors = colors; } @Override @@ -87,7 +87,7 @@ public class BonusPerBoardElement implements Effect { private int computeNbOfMatchingElementsIn(Board board) { switch (type) { case CARD: - return board.getNbCardsOfColor(color); + return board.getNbCardsOfColor(colors); case WONDER_LEVEL: return board.getWonderLevel(); case DEFEAT_TOKEN: |