summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/luxons/sevenwonders/game/api/HandCard.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/org/luxons/sevenwonders/game/api/HandCard.java b/src/main/java/org/luxons/sevenwonders/game/api/HandCard.java
index 80c09549..54045607 100644
--- a/src/main/java/org/luxons/sevenwonders/game/api/HandCard.java
+++ b/src/main/java/org/luxons/sevenwonders/game/api/HandCard.java
@@ -3,9 +3,13 @@ package org.luxons.sevenwonders.game.api;
import org.luxons.sevenwonders.game.boards.Board;
import org.luxons.sevenwonders.game.cards.Card;
+/**
+ * A card with contextual information relative to the hand it is sitting in. The extra information is especially
+ * useful because it frees the client from a painful business logic implementation.
+ */
public class HandCard {
- private final Card data;
+ private final Card card;
private final boolean chainable;
@@ -15,14 +19,14 @@ public class HandCard {
public HandCard(Card card, Table table, int playerIndex) {
Board board = table.getBoard(playerIndex);
- this.data = card;
+ this.card = card;
this.chainable = card.isChainableOn(board);
this.free = card.isAffordedBy(board) && card.getRequirements().getGold() == 0;
this.playable = card.isPlayable(table, playerIndex);
}
- public Card getData() {
- return data;
+ public Card getCard() {
+ return card;
}
public boolean isChainable() {
bgstack15