Browse Source

Add Shuffel for CardDeck

feature_solitaer_setup_GamePanel
Alexander Hartung 3 years ago
parent
commit
f6a2f009da
  1. 6
      src/main/java/solitaer/CardDeck.java
  2. 1
      src/main/java/solitaer/SolitaerGamePanel.java

6
src/main/java/solitaer/CardDeck.java

@ -1,6 +1,7 @@
package solitaer;
import java.util.ArrayList;
import java.util.Collections;
public class CardDeck {
@ -33,4 +34,9 @@ public class CardDeck {
return deck;
}
public void shuffelDeck() {
Collections.shuffle(deck);
}
}

1
src/main/java/solitaer/SolitaerGamePanel.java

@ -48,6 +48,7 @@ public class SolitaerGamePanel extends JPanel {
this.addMouseListener(mouseL);
deck = new CardDeck();
deck.shuffelDeck();
for (int i = 0; i < STARTSTACK_SIZE; i++) {
int y = setLayouty(1);

Loading…
Cancel
Save