Package controller
Class Hand
java.lang.Object
controller.Hand
Contains methods to calculate the value of a hand, take cards from a deck and
discard the hand to a deck.
- Author:
- Michael Neuper michael@michaelneuper.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCalculates the value of aHand.voiddiscardHandToDeck(Deck discardDeck) getCard(int i) Gets theCardat a specific index.getCardFilePath(int i) Gets the relative file path of aCard.voidtakeCardFromDeck(Deck deck) toString()Returns aStringrepresentation of the currentHand.
-
Constructor Details
-
Hand
public Hand()Constructs a new emptyHandobject.
-
-
Method Details
-
takeCardFromDeck
- Parameters:
deck- deck to takeCardfrom
-
calculateValue
public int calculateValue()Calculates the value of aHand.- Returns:
- the value of a
Hand
-
getCard
Gets theCardat a specific index. -
getCardFilePath
Gets the relative file path of aCard. -
discardHandToDeck
-
toString
Returns aStringrepresentation of the currentHand.
-