commit 30f6d07479e3d9d8c7d63d3f161649326d46b02a parent 8d0c8ebb6ba48affdaf008464378e352d2db0e62 Author: Michael Neuper <73108749+michaelneuper@users.noreply.github.com> Date: Sat, 8 Oct 2022 09:38:41 +0200 add decardHandToDeck method Diffstat:
| M | src/controller/Hand.java | | | 9 | +++++++++ |
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/controller/Hand.java b/src/controller/Hand.java @@ -67,6 +67,15 @@ public class Hand { public Card getCard(int i) { return hand.get(i); } + + /** + * Discards hand to deck + * @param discardDeck + */ + public void discardHandToDeck(Deck discardDeck) { + discardDeck.addCards(hand); // copy cards from discardDeck + hand.clear(); // clear the hand + } @Override public String toString() {