Exemplo n.º 1
0
        /// <summary>
        /// Returns a value for the given move that indicates its immediate threat.
        /// Non-capture moves have a default value of zero, while captures have a
        /// value that is the ratio of the captured piece to the moving piece. Pawns
        /// promoting to queen are given an additional increase in value.
        /// </summary>
        /// <param name="move">The move to consider.</param>
        /// <returns>A value for the given move that is useful for move ordering.</returns>
        private Single MoveOrderingValue(Int32 move)
        {
            Single value = PieceValue[Move.Capture(move)] / (Single)PieceValue[Move.Piece(move)];

            if (Move.IsQueenPromotion(move))
            {
                value += QueenPromotionMoveValue;
            }
            return(value);
        }