public ArrayList<Piece> getPiecesColor(boolean isBkack) {
        ArrayList<Piece> pieces = new ArrayList<Piece>();
        for (int row = 0; row < squares.length; row++) {
            for (int col = 0; col < squares[row].length; col++) {
                if (squares[col][row].getPiece() != null) {
                    if (isBkack && squares[col][row].getPiece().isBlack()) {
                        pieces.add(squares[col][row].getPiece());
                    } else if (!isBkack && !squares[col][row].getPiece().isBlack()) {
                        pieces.add(squares[col][row].getPiece());
                    }
                }
            }
        }

        return pieces;
    }