From 57691cffcfec462dbe6dffc0a2bad89cd366ddc6 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Fri, 16 Oct 2020 23:29:01 +0100 Subject: [PATCH] TableHand Class storing Cards "played" --- Personal/Cards/src/TableHand.java | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Personal/Cards/src/TableHand.java diff --git a/Personal/Cards/src/TableHand.java b/Personal/Cards/src/TableHand.java new file mode 100644 index 0000000..1945af5 --- /dev/null +++ b/Personal/Cards/src/TableHand.java @@ -0,0 +1,28 @@ +import java.util.EnumMap; +import java.util.Map.Entry; + +public class TableHand extends Hand { + + private EnumMap sevensTableHand = new EnumMap(Suits.class); + + public TableHand() { + for (Suits suit : Suits.values()) { + sevensTableHand.put(suit, new Hand()); + } + } + + public void display() { + System.out.println("Current Deck: "); + for (Entry hand : sevensTableHand.entrySet()) { + System.out.println(hand.getKey() + ": " + hand.getValue().toString()); + } + } + + public EnumMap getSevensTableHand() { + return sevensTableHand; + } + + public void setSevensTableHand(EnumMap sevensTableHand) { + this.sevensTableHand = sevensTableHand; + } +}