Example #1
0
 public Position(Position other)
 {
     squares = new int[64];
     for (int i = 0; i < 64; i++)
     {
         squares[i] = other.squares[i];
     }
     pieceTypeBB = new ulong[Piece.nPieceTypes];
     psScore1    = new /*short*/ int[Piece.nPieceTypes];
     psScore2    = new /*short*/ int[Piece.nPieceTypes];
     for (int i = 0; i < Piece.nPieceTypes; i++)
     {
         pieceTypeBB[i] = other.pieceTypeBB[i];
         psScore1[i]    = other.psScore1[i];
         psScore2[i]    = other.psScore2[i];
     }
     whiteBB         = other.whiteBB;
     blackBB         = other.blackBB;
     whiteMove       = other.whiteMove;
     castleMask      = other.castleMask;
     epSquare        = other.epSquare;
     halfMoveClock   = other.halfMoveClock;
     fullMoveCounter = other.fullMoveCounter;
     hashKey         = other.hashKey;
     pHashKey        = other.pHashKey;
     wKingSq         = other.wKingSq;
     bKingSq         = other.bKingSq;
     wMtrl           = other.wMtrl;
     bMtrl           = other.bMtrl;
     wMtrlPawns      = other.wMtrlPawns;
     bMtrlPawns      = other.bMtrlPawns;
 }
Example #2
0
        public int bMtrlPawns;       // Total value of all black pawns

        /** Initialize board to empty position. */
        public Position()
        {
            Co1();
            squares = new int[64];
            for (int i = 0; i < 64; i++)
            {
                squares[i] = Piece.EMPTY;
            }
            pieceTypeBB = new ulong[Piece.nPieceTypes];
            psScore1    = new /*short*/ int[Piece.nPieceTypes];
            psScore2    = new /*short*/ int[Piece.nPieceTypes];
            for (int i = 0; i < Piece.nPieceTypes; i++)
            {
                pieceTypeBB[i] = 0L;
                psScore1[i]    = 0;
                psScore2[i]    = 0;
            }
            whiteBB         = blackBB = 0L;
            whiteMove       = true;
            castleMask      = 0;
            epSquare        = -1;
            halfMoveClock   = 0;
            fullMoveCounter = 1;
            hashKey         = computeZobristHash();
            wKingSq         = bKingSq = -1;
            wMtrl           = bMtrl = -Evaluate.kV;
            wMtrlPawns      = bMtrlPawns = 0;
        }
Example #3
0
 /** Initialize board to empty position. */
 public Position()
 {
     Co1();
     squares = new int[64];
     for (int i = 0; i < 64; i++)
     squares[i] = Piece.EMPTY;
     pieceTypeBB = new ulong[Piece.nPieceTypes];
     psScore1 = new /*short*/ int[Piece.nPieceTypes];
     psScore2 = new /*short*/ int[Piece.nPieceTypes];
     for (int i = 0; i < Piece.nPieceTypes; i++) {
     pieceTypeBB[i] = 0L;
     psScore1[i] = 0;
     psScore2[i] = 0;
     }
     whiteBB = blackBB = 0L;
     whiteMove = true;
     castleMask = 0;
     epSquare = -1;
     halfMoveClock = 0;
     fullMoveCounter = 1;
     hashKey = computeZobristHash();
     wKingSq = bKingSq = -1;
     wMtrl = bMtrl = -Evaluate.kV;
     wMtrlPawns = bMtrlPawns = 0;
 }
Example #4
0
 public Position(Position other)
 {
     squares = new int[64];
     for (int i = 0; i < 64; i++)
     squares[i] = other.squares[i];
     pieceTypeBB = new ulong[Piece.nPieceTypes];
     psScore1 = new /*short*/ int[Piece.nPieceTypes];
     psScore2 = new /*short*/ int[Piece.nPieceTypes];
     for (int i = 0; i < Piece.nPieceTypes; i++) {
     pieceTypeBB[i] = other.pieceTypeBB[i];
     psScore1[i] = other.psScore1[i];
     psScore2[i] = other.psScore2[i];
     }
     whiteBB = other.whiteBB;
     blackBB = other.blackBB;
     whiteMove = other.whiteMove;
     castleMask = other.castleMask;
     epSquare = other.epSquare;
     halfMoveClock = other.halfMoveClock;
     fullMoveCounter = other.fullMoveCounter;
     hashKey = other.hashKey;
     pHashKey = other.pHashKey;
     wKingSq = other.wKingSq;
     bKingSq = other.bKingSq;
     wMtrl = other.wMtrl;
     bMtrl = other.bMtrl;
     wMtrlPawns = other.wMtrlPawns;
     bMtrlPawns = other.bMtrlPawns;
 }