summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjbion <joffrey.bion@amadeus.com>2016-12-24 23:18:24 +0100
committerjbion <joffrey.bion@amadeus.com>2016-12-24 23:18:24 +0100
commitd81b6bb2ff2c77cb58d159a1bd410f3ec199eaa1 (patch)
tree489355d0adbef95cfa6bb23cf8f5b05d1a915147 /src
parentAdd tests for Card.equals() and Card.hashcode() (diff)
downloadseven-wonders-d81b6bb2ff2c77cb58d159a1bd410f3ec199eaa1.tar.gz
seven-wonders-d81b6bb2ff2c77cb58d159a1bd410f3ec199eaa1.tar.bz2
seven-wonders-d81b6bb2ff2c77cb58d159a1bd410f3ec199eaa1.zip
Add add/removeGold methods on boards
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/boards/Board.java8
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/effects/GoldIncrease.java2
2 files changed, 9 insertions, 1 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 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
bgstack15