/// <summary> /// 搬一步棋的棋子 /// </summary> /// <param name="mv"></param> /// <returns></returns> public int MovePiece(int mv) { int sqSrc, sqDst; sqSrc = logic.Src(mv); sqDst = logic.Dst(mv); sbyte pcCaptured = currentBoard[sqDst]; if (pcCaptured != 0) { DeletePiece(sqDst, pcCaptured); } sbyte pc = currentBoard[sqSrc]; DeletePiece(sqSrc, pc); AddPiece(sqDst, pc); return(pcCaptured); }
/// <summary> /// 求MVV/LVA值 /// </summary> /// <param name="mv"></param> /// <returns></returns> public int MvvLva(int mv) { return((ucMvvLva[situation.CurrentBoard[chessLogic.Dst(mv)]] << 3) - ucMvvLva[situation.CurrentBoard[chessLogic.Src(mv)]]); }