Koronggenerálás kész.
This commit is contained in:
parent
fdc2b18bd7
commit
1b14e32589
|
@ -65,10 +65,21 @@ public class HanoiFormController {
|
|||
|
||||
private void korongGeneralas() {
|
||||
//System.out.println(jatekTerulet.widthProperty());
|
||||
korongSzelMax = jatekTerulet.getWidth()/3-2*KDIFF;
|
||||
korongSzelMax = jatekTerulet.getWidth()/3-KDIFF;
|
||||
for (int i = 0; i < korongokSzama; i++) {
|
||||
|
||||
Korong k = new Korong(szinek[i], korongSzelMax-i*KDIFF, korongMag);
|
||||
/*
|
||||
* Rectangle tlap = k.getTlap(); tlap.setLayoutX(0);
|
||||
* tlap.setLayoutY(i*30+100);
|
||||
* jatekTerulet.getChildren().add(tlap);
|
||||
*/
|
||||
r1.addKorong(k);
|
||||
}
|
||||
rudRajzolas();
|
||||
}
|
||||
|
||||
private void rudRajzolas() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -93,6 +104,8 @@ public class HanoiFormController {
|
|||
private Felhasznalo fh;
|
||||
private int korongokSzama;
|
||||
private double korongSzelMax;
|
||||
final private double KDIFF = 30;
|
||||
private Color[] szinek = {};
|
||||
final private double KDIFF = 14;
|
||||
private double korongMag = 20;
|
||||
private Color[] szinek = {Color.AQUA, Color.DARKGREY,Color.BEIGE,Color.RED,Color.GREEN,
|
||||
Color.YELLOW,Color.BLACK,Color.BLUE,Color.PINK,Color.WHITE};
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ public class Korong {
|
|||
this.szin = szin;
|
||||
this.szelesseg = szelesseg;
|
||||
this.magassag = magassag;
|
||||
tlap = new Rectangle(szelesseg, magassag, szin);
|
||||
}
|
||||
|
||||
public Color getSzin() {
|
||||
|
|
|
@ -18,6 +18,7 @@ public class Rud {
|
|||
this.szin = szin;
|
||||
this.szelesseg = szelesseg;
|
||||
this.magassag = magassag;
|
||||
korongok = new ArrayList<Korong>();
|
||||
}
|
||||
|
||||
public Rud(Rectangle tlap) {
|
||||
|
@ -26,7 +27,14 @@ public class Rud {
|
|||
this.szin = (Color)tlap.getFill();
|
||||
this.szelesseg = tlap.getWidth();
|
||||
this.magassag = tlap.getHeight();
|
||||
korongok = new ArrayList<Korong>();
|
||||
}
|
||||
|
||||
public void addKorong(Korong k) {
|
||||
//TODO ellenőrizni, hogy ne legyen nagyobb a korong a legfelsőnél
|
||||
korongok.add(k);
|
||||
}
|
||||
|
||||
|
||||
public Color getSzin() {
|
||||
return szin;
|
||||
|
|
Loading…
Reference in New Issue
Block a user