From 337594435a88245425e47e1cc5aa5cafa8e76cd4 Mon Sep 17 00:00:00 2001 From: Alexander Hartung Date: Fri, 4 Feb 2022 17:11:22 +0100 Subject: [PATCH] ADD last card to WasteStack --- src/main/java/solitaer/SolitaerGamePanel.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/solitaer/SolitaerGamePanel.java b/src/main/java/solitaer/SolitaerGamePanel.java index 86b40c8..0edca74 100644 --- a/src/main/java/solitaer/SolitaerGamePanel.java +++ b/src/main/java/solitaer/SolitaerGamePanel.java @@ -89,10 +89,14 @@ public class SolitaerGamePanel extends JPanel { waste = new WasteStack(setLayoutX(1), OFFSET_STACKS_Y); geber = new GeberStack(setLayoutX(0), OFFSET_STACKS_Y, waste); - while(deck.getDeck().size() != 0) { + while(deck.getDeck().size() != 1) { geber.addCard(deck.getDeck().remove(0)); } + Card card = deck.getDeck().remove(0); + card.setFaceUp(true); + waste.addCard(card); + this.add(waste); this.add(geber);