diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2016-12-15 00:41:18 +0100 |
---|---|---|
committer | Joffrey BION <joffrey.bion@gmail.com> | 2016-12-15 00:43:51 +0100 |
commit | 5c937e0fb48332f0a3e5114423359ccc9869154b (patch) | |
tree | 7868c241429a0ba9b6b63c0bfcde82791a6e21e1 /src/test/java/org | |
parent | Add deal() method to the Decks (diff) | |
download | seven-wonders-5c937e0fb48332f0a3e5114423359ccc9869154b.tar.gz seven-wonders-5c937e0fb48332f0a3e5114423359ccc9869154b.tar.bz2 seven-wonders-5c937e0fb48332f0a3e5114423359ccc9869154b.zip |
Improve card requirements management
- Add chain-related fields to the Card
- Add helpers methods isAffordable, isPlayable and the likes
- Remove the card addition to the board as it is supposed to be separately from applying the effect of the card
Diffstat (limited to 'src/test/java/org')
-rw-r--r-- | src/test/java/org/luxons/sevenwonders/game/cards/CardTest.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test/java/org/luxons/sevenwonders/game/cards/CardTest.java b/src/test/java/org/luxons/sevenwonders/game/cards/CardTest.java index 572a7ee4..62bf376d 100644 --- a/src/test/java/org/luxons/sevenwonders/game/cards/CardTest.java +++ b/src/test/java/org/luxons/sevenwonders/game/cards/CardTest.java @@ -12,7 +12,6 @@ import org.luxons.sevenwonders.game.effects.ProductionIncrease; import org.luxons.sevenwonders.game.resources.ResourceType; import org.luxons.sevenwonders.game.wonders.Wonder; -import static junit.framework.TestCase.assertTrue; import static org.junit.Assert.assertEquals; public class CardTest { @@ -40,7 +39,7 @@ public class CardTest { List<Effect> effects = Collections.singletonList(treeFarmEffect); - treeFarmCard = new Card("Tree Farm", Color.BROWN, treeFarmRequirements, effects); + treeFarmCard = new Card("Tree Farm", Color.BROWN, treeFarmRequirements, "", effects, null); } @Test @@ -51,9 +50,8 @@ public class CardTest { @Test public void playCardCostingMoney() { board.setGold(3); - treeFarmCard.play(board, leftBoard, rightBoard); + treeFarmCard.applyTo(board, leftBoard, rightBoard); assertEquals(2, board.getGold()); - assertTrue(board.getPlayedCards().contains(treeFarmCard)); } } |