}
int Position::see(Move m) const {
+ return do_see<false>(m, 0);
+}
+
+int Position::see_asymm(Move m, int asymmThreshold) const
+{
+ return do_see<true>(m, asymmThreshold);
+}
+
+template <bool Asymmetric>
+int Position::do_see(Move m, int asymmThreshold) const {
Square from, to;
Bitboard occupied, attackers, stmAttackers;
} while (stmAttackers);
+ // FIXME: Document
+ if (Asymmetric)
+ {
+ for (int i = 0; i < slIndex ; i += 2)
+ {
+ if (swapList[i] < asymmThreshold)
+ swapList[i] = - QueenValueMg * 16;
+ }
+ }
+
// Having built the swap list, we negamax through it to find the best
// achievable score from the point of view of the side to move.
while (--slIndex)