librejack

Blackjack clone written in java
git clone https://github.com/michaelneuper/librejack.git
README | Files | Log | Refs | LICENSE

commit 8c03f00e6b0f6d32fa09eab40deb4346bcdf7106
parent 44505942c5ad4b8126aa6542cb5a479cb32a0334
Author: Michael Neuper <73108749+michaelneuper@users.noreply.github.com>
Date:   Fri, 15 Jul 2022 23:54:48 +0200

create Hand.java

Diffstat:
Asrc/controller/Hand.java | 26++++++++++++++++++++++++++
1 file changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/controller/Hand.java b/src/controller/Hand.java @@ -0,0 +1,26 @@ +package controller; + +import java.util.ArrayList; + +import model.Card; +import model.Deck; + +/** + * Contains methods to calculate the value of a hand, take cards from a deck and discard the hand to a deck. + * @author michael + */ +public class Hand { + + private ArrayList<Card> hand; + + /** + * Hand constructor + */ + public Hand() { + hand = new ArrayList<Card>(); + } + + public void takeCardFromDeck(Deck deck) { + hand.add(deck.takeCard()); + } +}