|
|
@ -62,9 +62,7 @@ public class VueJeu {
|
|
|
|
for(int i=0; i < colGame.getValue().intValue(); ++i) {
|
|
|
|
for(int i=0; i < colGame.getValue().intValue(); ++i) {
|
|
|
|
for(int j=0; j < rowGame.getValue().intValue(); ++j) {
|
|
|
|
for(int j=0; j < rowGame.getValue().intValue(); ++j) {
|
|
|
|
Rectangle rect = new Rectangle(15, 15, color.getValue());
|
|
|
|
Rectangle rect = new Rectangle(15, 15, color.getValue());
|
|
|
|
//manager.getActualiseurCellule().getArbitre().getPlateau().getCell(j, i).activeColorProperty().bindBidirectional(rect.fillProperty());
|
|
|
|
|
|
|
|
rect.fillProperty().bindBidirectional(manager.getActualiseurCellule().getArbitre().getPlateau().getCell(j, i).activeColorProperty());
|
|
|
|
rect.fillProperty().bindBidirectional(manager.getActualiseurCellule().getArbitre().getPlateau().getCell(j, i).activeColorProperty());
|
|
|
|
//rect.setOnMouseClicked(event -> changeColor(event));
|
|
|
|
|
|
|
|
map.add(rect, i, j);
|
|
|
|
map.add(rect, i, j);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -83,10 +81,11 @@ public class VueJeu {
|
|
|
|
|
|
|
|
|
|
|
|
public void generateraRandom() {
|
|
|
|
public void generateraRandom() {
|
|
|
|
//createGrid(manager.getActualiseurCellule().getArbitre().getPlateau().getLargeur(), manager.getActualiseurCellule().getArbitre().getPlateau().getLongueur());
|
|
|
|
//createGrid(manager.getActualiseurCellule().getArbitre().getPlateau().getLargeur(), manager.getActualiseurCellule().getArbitre().getPlateau().getLongueur());
|
|
|
|
for(int i=0; i<20; ++i) {
|
|
|
|
resetGrid();
|
|
|
|
Random random = new Random();
|
|
|
|
|
|
|
|
int largeur = manager.getActualiseurCellule().getArbitre().getPlateau().getLargeur();
|
|
|
|
int largeur = manager.getActualiseurCellule().getArbitre().getPlateau().getLargeur();
|
|
|
|
int longueur = manager.getActualiseurCellule().getArbitre().getPlateau().getLongueur();
|
|
|
|
int longueur = manager.getActualiseurCellule().getArbitre().getPlateau().getLongueur();
|
|
|
|
|
|
|
|
for(int i=0; i<20; ++i) {
|
|
|
|
|
|
|
|
Random random = new Random();
|
|
|
|
manager.getActualiseurCellule().getArbitre().getPlateau().getCell(random.nextInt(longueur), random.nextInt(largeur)).setAlive(true);
|
|
|
|
manager.getActualiseurCellule().getArbitre().getPlateau().getCell(random.nextInt(longueur), random.nextInt(largeur)).setAlive(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|