src/gui/GUI.java
public static boolean game() {
        turnMessage.setText("Turn: " + board.getTurn());

        int row = board.getLastMove().getRow();
        int col = board.getLastMove().getColumn();
        int currentPlayer = board.getLastPlayer();

        if (currentPlayer == Constants.P1) {
            // It places a checker in the corresponding [row][col] of the GUI.
            placeChecker(gameParameters.getPlayer1Color(), row, col);
        }

        if (currentPlayer == Constants.P2) {
            // It places a checker in the corresponding [row][col] of the GUI.
            placeChecker(gameParameters.getPlayer2Color(), row, col);
        }

        System.out.println("Turn: " + board.getTurn());
        Board.printBoard(board.getGameBoard());

        boolean isGameOver = board.checkForGameOver();
        if (isGameOver) {
            gameOver();
        } else {
            undoButton.setEnabled(true);
            if (gameParameters.getGuiStyle() == GuiStyle.NIMBUS_STYLE) undoButton.setVisible(true);
            undoItem.setEnabled(true);
        }

        redoBoards.clear();
        redoCheckerLabels.clear();
        redoButton.setEnabled(false);
        if (gameParameters.getGuiStyle() == GuiStyle.NIMBUS_STYLE) redoButton.setVisible(false);
        redoItem.setEnabled(false);

        return isGameOver;
    }
// Gets called after makeMove(int, col) is called.
Gets called after makeMove(int, col) is called.
Gets called after makeMove ( int col ) is called .
public static boolean game() {
        turnMessage.setText("Turn: " + board.getTurn());
        int row = board.getLastMove().getRow();
        int col = board.getLastMove().getColumn();
        int currentPlayer = board.getLastPlayer();
        if (currentPlayer == Constants.P1) {
            placeChecker(gameParameters.getPlayer1Color(), row, col);
        }
        if (currentPlayer == Constants.P2) {
            placeChecker(gameParameters.getPlayer2Color(), row, col);
        }
        System.out.println("Turn: " + board.getTurn());
        Board.printBoard(board.getGameBoard());
        boolean isGameOver = board.checkForGameOver();
        if (isGameOver) {
            gameOver();
        } else {
            undoButton.setEnabled(true);
            if (gameParameters.getGuiStyle() == GuiStyle.NIMBUS_STYLE) undoButton.setVisible(true);
            undoItem.setEnabled(true);
        }
        redoBoards.clear();
        redoCheckerLabels.clear();
        redoButton.setEnabled(false);
        if (gameParameters.getGuiStyle() == GuiStyle.NIMBUS_STYLE) redoButton.setVisible(false);
        redoItem.setEnabled(false);
        return isGameOver;
    }
public static boolean game ( ) { turnMessage . setText ( "Turn: " + board . getTurn ( ) ) ; int row = board . getLastMove ( ) . getRow ( ) ; int col = board . getLastMove ( ) . getColumn ( ) ; int currentPlayer = board . getLastPlayer ( ) ; if ( currentPlayer == Constants . P1 ) { placeChecker ( gameParameters . getPlayer1Color ( ) , row , col ) ; } if ( currentPlayer == Constants . P2 ) { placeChecker ( gameParameters . getPlayer2Color ( ) , row , col ) ; } System . out . println ( "Turn: " + board . getTurn ( ) ) ; Board . printBoard ( board . getGameBoard ( ) ) ; boolean isGameOver = board . checkForGameOver ( ) ; if ( isGameOver ) { gameOver ( ) ; } else { undoButton . setEnabled ( true ) ; if ( gameParameters . getGuiStyle ( ) == GuiStyle . NIMBUS_STYLE ) undoButton . setVisible ( true ) ; undoItem . setEnabled ( true ) ; } redoBoards . clear ( ) ; redoCheckerLabels . clear ( ) ; redoButton . setEnabled ( false ) ; if ( gameParameters . getGuiStyle ( ) == GuiStyle . NIMBUS_STYLE ) redoButton . setVisible ( false ) ; redoItem . setEnabled ( false ) ; return isGameOver ; }
Gets called after makeMove(int, col) is called.
Gets called after makeMove ( int col ) is called .
// It places a checker in the corresponding [row][col] of the GUI. // It places a checker in the corresponding [row][col] of the GUI.