From d81b6bb2ff2c77cb58d159a1bd410f3ec199eaa1 Mon Sep 17 00:00:00 2001 From: jbion Date: Sat, 24 Dec 2016 23:18:24 +0100 Subject: Add add/removeGold methods on boards --- src/main/java/org/luxons/sevenwonders/game/boards/Board.java | 8 ++++++++ .../java/org/luxons/sevenwonders/game/effects/GoldIncrease.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main/java/org') 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 d0fc22b8..0295b09a 100644 --- a/src/main/java/org/luxons/sevenwonders/game/boards/Board.java +++ b/src/main/java/org/luxons/sevenwonders/game/boards/Board.java @@ -83,6 +83,14 @@ public class Board { this.gold = amount; } + public void addGold(int amount) { + this.gold += amount; + } + + public void removeGold(int amount) { + this.gold -= amount; + } + public int getNbWarSymbols() { return nbWarSymbols; } diff --git a/src/main/java/org/luxons/sevenwonders/game/effects/GoldIncrease.java b/src/main/java/org/luxons/sevenwonders/game/effects/GoldIncrease.java index 5d4e5817..79e7bd1a 100644 --- a/src/main/java/org/luxons/sevenwonders/game/effects/GoldIncrease.java +++ b/src/main/java/org/luxons/sevenwonders/game/effects/GoldIncrease.java @@ -18,7 +18,7 @@ public class GoldIncrease extends InstantOwnBoardEffect { @Override public void apply(Board board) { - board.setGold(board.getGold() + amount); + board.addGold(amount); } @Override -- cgit