Browse Source

ADD all remaining Cards to GeberStack

feature_solitaer_setup_GamePanel
Alexander Hartung 3 years ago
parent
commit
abecb9f8be
  1. 9
      src/main/java/solitaer/SolitaerGamePanel.java

9
src/main/java/solitaer/SolitaerGamePanel.java

@ -33,7 +33,6 @@ public class SolitaerGamePanel extends JPanel {
public SolitaerGamePanel() { public SolitaerGamePanel() {
setLayout(null); setLayout(null);
int Offset_x_Save = setLayoutX(STARTSTACK_SIZE + 1); int Offset_x_Save = setLayoutX(STARTSTACK_SIZE + 1);
int Offset_y_Save = setLayouty(1); int Offset_y_Save = setLayouty(1);
@ -45,12 +44,10 @@ public class SolitaerGamePanel extends JPanel {
save = new SaveStack(Offset_x_Save, Offset_y_Save); save = new SaveStack(Offset_x_Save, Offset_y_Save);
this.add(save); this.add(save);
mouseL = new MyMouseListener(save); mouseL = new MyMouseListener(save);
this.addMouseListener(mouseL); this.addMouseListener(mouseL);
deck = new CardDeck(); deck = new CardDeck();
System.out.println(deck.getDeck().size());
for (int i = 0; i < STARTSTACK_SIZE; i++) { for (int i = 0; i < STARTSTACK_SIZE; i++) {
int y = setLayouty(1); int y = setLayouty(1);
@ -65,7 +62,6 @@ public class SolitaerGamePanel extends JPanel {
start[i].addCard(card); start[i].addCard(card);
this.add(start[i]); this.add(start[i]);
} }
System.out.println(deck.getDeck().size());
for (int i = 0; i < ABLAGESTACK_SIZE; i++) { for (int i = 0; i < ABLAGESTACK_SIZE; i++) {
int x = setLayoutX(((STARTSTACK_SIZE - ABLAGESTACK_SIZE) + i)); int x = setLayoutX(((STARTSTACK_SIZE - ABLAGESTACK_SIZE) + i));
@ -92,6 +88,11 @@ public class SolitaerGamePanel extends JPanel {
waste = new WasteStack(setLayoutX(1), OFFSET_STACKS_Y); waste = new WasteStack(setLayoutX(1), OFFSET_STACKS_Y);
geber = new GeberStack(setLayoutX(0), OFFSET_STACKS_Y, waste); geber = new GeberStack(setLayoutX(0), OFFSET_STACKS_Y, waste);
while(deck.getDeck().size() != 0) {
geber.addCard(deck.getDeck().remove(0));
}
this.add(waste); this.add(waste);
this.add(geber); this.add(geber);

Loading…
Cancel
Save