src/edu/isep/jeudes6couleurs/game/grids/GridSquare.java
/**
   * Permet d'afficher la grille en mode 2D
   */
Permet d'afficher la grille en mode 2D
Permet d ' afficher la grille en mode 2D
public GridPane show2D(Game game) {
    GridPane gameGrid = new GridPane();
    for (int i = 0; i < size; i++) {
      for (int j = 0; j < size; j++) {
        Tile tile = getTile(i, j);
        int  pID  = tile.getPlayerID();
        Button button = new Button();
        button.getStyleClass().add("tile");
        button.getStyleClass().add(TileColor.getColorClassName(tile.getColor()));
        if (size > 19) {
          button.getStyleClass().add("small");
        }
        if (pID != 0) {
          button.setText(Integer.toString(pID));
        }
        button.setOnAction(event -> {
          game.chooseColor(tile.getColor());
        });
        gameGrid.add(button, j, i);
      }
    }
    return gameGrid;
  }
public GridPane show2D ( Game game ) { GridPane gameGrid = new GridPane ( ) ; for ( int i = 0 ; i < size ; i ++ ) { for ( int j = 0 ; j < size ; j ++ ) { Tile tile = getTile ( i , j ) ; int pID = tile . getPlayerID ( ) ; Button button = new Button ( ) ; button . getStyleClass ( ) . add ( "tile" ) ; button . getStyleClass ( ) . add ( TileColor . getColorClassName ( tile . getColor ( ) ) ) ; if ( size > 19 ) { button . getStyleClass ( ) . add ( "small" ) ; } if ( pID != 0 ) { button . setText ( Integer . toString ( pID ) ) ; } button . setOnAction ( event -> { game . chooseColor ( tile . getColor ( ) ) ; } ) ; gameGrid . add ( button , j , i ) ; } } return gameGrid ; }
Permet d'afficher la grille en mode 2D
Permet d ' afficher la grille en mode 2D