Amélioration plateau

This commit is contained in:
Paul Gross
2020-04-30 19:10:41 +02:00
parent d476733172
commit ba5976ec93
8 changed files with 764 additions and 563 deletions

View File

@@ -0,0 +1,39 @@
package ihm.controller;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
public class GestionnaireDePions {
private Pion pionVie;
private Pion pionLieu;
private GridPane gridPaneVie;
public GestionnaireDePions(Color color,GridPane gridPaneVie) {
this.gridPaneVie = gridPaneVie;
this.pionVie = new Pion(color);
this.pionLieu = new Pion(color);
}
public void deplacerPionVie(int damage) {
GridPane gp = this.gridPaneVie;
System.out.println(gp);
int row = pionVie.getPosition().x;
StackPane nAncient = (StackPane) gp.getChildren().get(row);
FlowPane fpAncient = (FlowPane) nAncient.getChildren().get(0);
fpAncient.getChildren().remove(pionVie);
StackPane nNew = (StackPane) gp.getChildren().get(damage);
FlowPane fpNew = (FlowPane) nNew.getChildren().get(0);
fpNew.getChildren().add(pionVie);
}
public void deplacerPionLieux() {
}
}