Browse Source

Set Layout AblageStacks

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

72
src/main/java/solitaer/SolitaerGamePanel.java

@ -18,6 +18,7 @@ public class SolitaerGamePanel extends JPanel {
private SaveStack save =new SaveStack(500,250); private SaveStack save =new SaveStack(500,250);
private StartStack[] start = new StartStack[7] ; private StartStack[] start = new StartStack[7] ;
private AblageStack[] ablage = new AblageStack[4];
@ -39,56 +40,33 @@ public class SolitaerGamePanel extends JPanel {
this.add(start[i]); this.add(start[i]);
} }
// StartStack a = new StartStack(25,125);
//
// deck.getDeck().get(5).setFaceUp(true);
// a.addCard((deck.getDeck().get(5)));
//
// deck.getDeck().get(4).setFaceUp(true);
// a.addCard((deck.getDeck().get(4)));
//
// deck.getDeck().get(3).setFaceUp(true);
// a.addCard((deck.getDeck().get(3)));
//
// deck.getDeck().get(2).setFaceUp(true);
// a.addCard((deck.getDeck().get(2)));
//
// deck.getDeck().get(1).setFaceUp(true);
// a.addCard((deck.getDeck().get(1)));
//
// deck.getDeck().get(0).setFaceUp(true);
// a.addCard(deck.getDeck().get(0));
//
// this.add(a);
//
// StartStack b = new StartStack(200,125);
//
// deck.getDeck().get(32).setFaceUp(true);
// b.addCard((deck.getDeck().get(32)));
// this.add(b);
//
// StartStack c = new StartStack(375,125);
//
// //deck.getDeck().get(20).setFaceUp(true);
// c.addCard((deck.getDeck().get(20)));
// this.add(c);
//
//
// StartStack d = new StartStack(475,125);
// this.add(d);
//save = new SaveStack(500,250);
this.add(save);
for(int i = 0; i<4; i++) {
int x = (((IMAGE_WIDTH+OFFSET_STACKS)*(3+i))+OFFSET_STACKS);
switch (i) {
case 0:
ablage[i] = new AblageStack(x, 10, Symbol.Herz);
break;
case 1:
ablage[i] = new AblageStack(x, 10, Symbol.Kreuz);
break;
case 2:
ablage[i] = new AblageStack(x, 10, Symbol.Karo);
break;
case 3:
ablage[i] = new AblageStack(x, 10, Symbol.Pik);
break;
default:
break;
}
this.add(ablage[i]);
}
AblageStack a1 = new AblageStack(200, 10, Symbol.Herz);
this.add(a1);
AblageStack a2 = new AblageStack(275, 10, Symbol.Kreuz);
this.add(a2);
AblageStack a3 = new AblageStack(350, 10, Symbol.Karo);
this.add(a3);
AblageStack a4 = new AblageStack(425, 10, Symbol.Pik);
this.add(a4);
//save = new SaveStack(500,250);
this.add(save);
WasteStack w = new WasteStack(85, 10); WasteStack w = new WasteStack(85, 10);

Loading…
Cancel
Save