// Path: BootsFacesChess/src/main/java/de/beyondjava/bootsfaces/chess/common/Move.java
// public class Move implements Comparable<Move> {
//     public int fromColumn;
//     public int fromRow;
//     public int toColumn;
//     public int toRow;
//     public int materialValueAfterMove;
//     public boolean opponentInCheck;
//     public int positionalValue = 0;
//     public boolean capture;
//     public int piece;
//     public int capturedPiece;
//     public int boardAfterMove; // used by PrimitiveMoveGenerator
//     public int moveValue; // value of the board after the move, according to the possible moves
// 
//     public Move(int piece, int fromRow, int fromColumn, int toRow, int toColumn, int materialValueAfterMove, boolean opponentInCheck, boolean capture, int capturedPiece) {
//         this.piece = piece;
//         this.fromColumn = fromColumn;
//         this.fromRow = fromRow;
//         this.toRow = toRow;
//         this.toColumn = toColumn;
//         this.materialValueAfterMove = materialValueAfterMove;
//         this.opponentInCheck = opponentInCheck;
//         this.capture = capture;
//         this.capturedPiece = capturedPiece;
//     }
// 
//     @Override
//     public int compareTo(Move o) {
//         if (null == o) return -1;
//         int m = o.materialValueAfterMove - materialValueAfterMove;
//         int p = o.positionalValue - positionalValue;
//         return -(m + p);
//     }
// 
//     public String getNotation() {
//         return getNotation(false);
//     }
// 
//         public String getNotation(boolean enPassant) {
//         String check = opponentInCheck ? "+" : " ";
//         String s = capture ? "x" : "-";
//         s += PIECE_NAME[capturedPiece + 1];
//         if (piece==W_KING && fromRow==7 && toRow==7 && fromColumn==4 && toColumn==6)
//         {
//             return "0-0";
//         }
//         if (piece==W_KING && fromRow==7 && toRow==7 && fromColumn==4 && toColumn==2)
//         {
//             return "0-0-0";
//         }
//         if (piece==B_KING && fromRow==0 && toRow==0 && fromColumn==4 && toColumn==6)
//         {
//             return "0-0";
//         }
//         if (piece==B_KING && fromRow==0 && toRow==0 && fromColumn==4 && toColumn==2)
//         {
//             return "0-0-0";
//         }
//         String ep=enPassant?"e.p.":"";
// 
//         return PIECE_NAME[piece + 1] + COLUMNS[fromColumn] + ROWS[fromRow] + s + COLUMNS[toColumn] + ROWS[toRow] + ep + check;
//     }
// 
//     public String toString() {
//         String m = String.format("%5d", materialValueAfterMove);
//         String p = String.format("%5d", positionalValue);
//         String mv = String.format("%5d", moveValue);
//         String s = String.format("%5d", materialValueAfterMove + positionalValue + moveValue);
//         return getNotation() + " Value: M: " + m + " P: " + p + " Mv:" + mv + " Sum: " + s;
//     }
// }


import de.beyondjava.bootsfaces.chess.common.Move;
    public int blackPotentialMaterialValue;
    public int whiteFieldPositionValue;
    public int blackFieldPositionValue;
    public int whiteMoveValue;
    public int blackMoveValue;
    public int whiteCoverageValue;
    public int blackCoverageValue;
    public boolean isWhiteKingThreatened;
    public boolean isBlackKingThreatened;
    public int whiteTotalValue;
    public int blackTotalValue;
    public int numberOfWhiteMoves;
    public int numberOfBlackMoves ;
    public int piece;
    public Chessboard boardAfterMove;
    public boolean stalemate;
    public boolean checkmate;

    @Override
    public int compareTo(XMove o) {
        return (whiteTotalValue-blackTotalValue) - (o.whiteTotalValue-o.blackTotalValue);
    }

    public String getNotation()
    {
        int fromRow = (move >> 12) & 0x000F;
        int fromColumn = (move >> 8) & 0x000F;
        int toRow = (move >> 4) & 0x000F;
        int toColumn = move & 0x000F;
        boolean capture = (move >> 24)>0;
// Path: BootsFacesChess/src/main/java/de/beyondjava/bootsfaces/chess/common/Move.java
// public class Move implements Comparable<Move> {
//     public int fromColumn;
//     public int fromRow;
//     public int toColumn;
//     public int toRow;
//     public int materialValueAfterMove;
//     public boolean opponentInCheck;
//     public int positionalValue = 0;
//     public boolean capture;
//     public int piece;
//     public int capturedPiece;
//     public int boardAfterMove; // used by PrimitiveMoveGenerator
//     public int moveValue; // value of the board after the move, according to the possible moves
// 
//     public Move(int piece, int fromRow, int fromColumn, int toRow, int toColumn, int materialValueAfterMove, boolean opponentInCheck, boolean capture, int capturedPiece) {
//         this.piece = piece;
//         this.fromColumn = fromColumn;
//         this.fromRow = fromRow;
//         this.toRow = toRow;
//         this.toColumn = toColumn;
//         this.materialValueAfterMove = materialValueAfterMove;
//         this.opponentInCheck = opponentInCheck;
//         this.capture = capture;
//         this.capturedPiece = capturedPiece;
//     }
// 
//     @Override
//     public int compareTo(Move o) {
//         if (null == o) return -1;
//         int m = o.materialValueAfterMove - materialValueAfterMove;
//         int p = o.positionalValue - positionalValue;
//         return -(m + p);
//     }
// 
//     public String getNotation() {
//         return getNotation(false);
//     }
// 
//         public String getNotation(boolean enPassant) {
//         String check = opponentInCheck ? "+" : " ";
//         String s = capture ? "x" : "-";
//         s += PIECE_NAME[capturedPiece + 1];
//         if (piece==W_KING && fromRow==7 && toRow==7 && fromColumn==4 && toColumn==6)
//         {
//             return "0-0";
//         }
//         if (piece==W_KING && fromRow==7 && toRow==7 && fromColumn==4 && toColumn==2)
//         {
//             return "0-0-0";
//         }
//         if (piece==B_KING && fromRow==0 && toRow==0 && fromColumn==4 && toColumn==6)
//         {
//             return "0-0";
//         }
//         if (piece==B_KING && fromRow==0 && toRow==0 && fromColumn==4 && toColumn==2)
//         {
//             return "0-0-0";
//         }
//         String ep=enPassant?"e.p.":"";
// 
//         return PIECE_NAME[piece + 1] + COLUMNS[fromColumn] + ROWS[fromRow] + s + COLUMNS[toColumn] + ROWS[toRow] + ep + check;
//     }
// 
//     public String toString() {
//         String m = String.format("%5d", materialValueAfterMove);
//         String p = String.format("%5d", positionalValue);
//         String mv = String.format("%5d", moveValue);
//         String s = String.format("%5d", materialValueAfterMove + positionalValue + moveValue);
//         return getNotation() + " Value: M: " + m + " P: " + p + " Mv:" + mv + " Sum: " + s;
//     }
// }


// Path: BootsFacesChess/src/main/java/de/beyondjava/bootsfaces/chess/objectOrientedEngine/XMove.java
import de.beyondjava.bootsfaces.chess.common.Move;

    public int blackPotentialMaterialValue;
    public int whiteFieldPositionValue;
    public int blackFieldPositionValue;
    public int whiteMoveValue;
    public int blackMoveValue;
    public int whiteCoverageValue;
    public int blackCoverageValue;
    public boolean isWhiteKingThreatened;
    public boolean isBlackKingThreatened;
    public int whiteTotalValue;
    public int blackTotalValue;
    public int numberOfWhiteMoves;
    public int numberOfBlackMoves ;
    public int piece;
    public Chessboard boardAfterMove;
    public boolean stalemate;
    public boolean checkmate;

    @Override
    public int compareTo(XMove o) {
        return (whiteTotalValue-blackTotalValue) - (o.whiteTotalValue-o.blackTotalValue);
    }

    public String getNotation()
    {
        int fromRow = (move >> 12) & 0x000F;
        int fromColumn = (move >> 8) & 0x000F;
        int toRow = (move >> 4) & 0x000F;
        int toColumn = move & 0x000F;
        boolean capture = (move >> 24)>0;
        Move m = new Move(piece, fromRow, fromColumn, toRow, toColumn, 0, false, capture, 0 );