Ejemplo n.º 1
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="moveHistory">  MoveHistory template</param>
 private MoveHistory(MoveHistory moveHistory)
 {
     m_iMoveCount            = moveHistory.m_iMoveCount;
     m_iCountMoveDepth       = moveHistory.m_iCountMoveDepth;
     m_iPackedBoardArraySize = moveHistory.m_iPackedBoardArraySize;
     m_arrPackedBoard        = (PackedBoard[])moveHistory.m_arrPackedBoard.Clone();
     m_arrHashCount          = (byte[])moveHistory.m_arrHashCount.Clone();
     m_arrCountMove          = (short[])moveHistory.m_arrCountMove.Clone();
     m_packedBoardCurrent    = moveHistory.m_packedBoardCurrent;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="moveHistory">  MoveHistory template</param>
 private MoveHistory(MoveHistory moveHistory)
 {
     m_iMoveCount            = moveHistory.m_iMoveCount;
     m_iCountMoveDepth       = moveHistory.m_iCountMoveDepth;
     m_iPackedBoardArraySize = moveHistory.m_iPackedBoardArraySize;
     m_arrPackedBoard        = (PackedBoard[])moveHistory.m_arrPackedBoard.Clone();
     m_arrHashCount          = (byte[])moveHistory.m_arrHashCount.Clone();
     m_arrCountMove          = (short[])moveHistory.m_arrCountMove.Clone();
     m_packedBoardCurrent    = moveHistory.m_packedBoardCurrent;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Copy the state of the board from the specified one.
 /// </summary>
 /// <param name="chessBoard">   Board to copy from</param>
 public void CopyFrom(ChessBoard chessBoard)
 {
     chessBoard.m_pBoard.CopyTo(m_pBoard, 0);
     chessBoard.m_piPiecesCount.CopyTo(m_piPiecesCount, 0);
     m_stackPossibleEnPassantAt  = new Stack<int>(chessBoard.m_stackPossibleEnPassantAt.ToArray());
     m_book                      = chessBoard.m_book;
     m_iBlackKingPos             = chessBoard.m_iBlackKingPos;
     m_iWhiteKingPos             = chessBoard.m_iWhiteKingPos;
     m_rnd                       = chessBoard.m_rnd;
     m_rndRep                    = chessBoard.m_rndRep;
     m_iRBlackRookMoveCount      = chessBoard.m_iRBlackRookMoveCount;
     m_iLBlackRookMoveCount      = chessBoard.m_iLBlackRookMoveCount;
     m_iBlackKingMoveCount       = chessBoard.m_iBlackKingMoveCount;
     m_iRWhiteRookMoveCount      = chessBoard.m_iRWhiteRookMoveCount;
     m_iLWhiteRookMoveCount      = chessBoard.m_iLWhiteRookMoveCount;
     m_iWhiteKingMoveCount       = chessBoard.m_iWhiteKingMoveCount;
     m_bWhiteCastle              = chessBoard.m_bWhiteCastle;
     m_bBlackCastle              = chessBoard.m_bBlackCastle;
     m_iPossibleEnPassantAt      = chessBoard.m_iPossibleEnPassantAt;
     m_i64ZobristKey             = chessBoard.m_i64ZobristKey;
     m_trace                     = chessBoard.m_trace;
     m_moveStack                 = chessBoard.m_moveStack.Clone();
     m_moveHistory               = chessBoard.m_moveHistory.Clone();
     m_eNextMoveColor            = chessBoard.m_eNextMoveColor;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Class constructor. Build a board.
 /// </summary>
 private ChessBoard(SearchEngineAlphaBeta searchEngineAlphaBeta, SearchEngineMinMax searchEngineMinMax)
 {
     m_pBoard                    = new PieceE[64];
     m_book                      = new Book();
     m_piPiecesCount             = new int[16];
     m_rnd                       = new Random((int)DateTime.Now.Ticks);
     m_rndRep                    = new Random(0);
     m_stackPossibleEnPassantAt  = new Stack<int>(256);
     m_trace                     = null;
     m_moveHistory               = new MoveHistory();
     m_bDesignMode               = false;
     m_moveStack                 = new MovePosStack();
     m_searchEngineAlphaBeta     = searchEngineAlphaBeta;
     m_searchEngineMinMax        = searchEngineMinMax;
     ResetBoard();
 }