summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorjbion <joffrey.bion@amadeus.com>2016-12-22 14:40:14 +0100
committerjbion <joffrey.bion@amadeus.com>2016-12-22 14:40:14 +0100
commit7d4235b1ec2bc61bfe39a256f40e3a60d822657f (patch)
treeff5a91ed12ed1551836de4534321bab3dc6e980a /src/main
parentFix shipowners guild card effect (diff)
downloadseven-wonders-7d4235b1ec2bc61bfe39a256f40e3a60d822657f.tar.gz
seven-wonders-7d4235b1ec2bc61bfe39a256f40e3a60d822657f.tar.bz2
seven-wonders-7d4235b1ec2bc61bfe39a256f40e3a60d822657f.zip
Add HandCard doc
Diffstat (limited to 'src/main')
-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