From 7d4235b1ec2bc61bfe39a256f40e3a60d822657f Mon Sep 17 00:00:00 2001 From: jbion Date: Thu, 22 Dec 2016 14:40:14 +0100 Subject: Add HandCard doc --- src/main/java/org/luxons/sevenwonders/game/api/HandCard.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/main/java') 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() { -- cgit