- mobility = evaluate_pieces_of_color<WHITE, HasPopCnt>(pos, ei)
- - evaluate_pieces_of_color<BLACK, HasPopCnt>(pos, ei);
- ei.value += apply_weight(mobility, Weights[Mobility]);
-
- // Kings. Kings are evaluated after all other pieces for both sides,
- // because we need complete attack information for all pieces when computing
- // the king safety evaluation.
- evaluate_king<WHITE, HasPopCnt>(pos, ei);
- evaluate_king<BLACK, HasPopCnt>(pos, ei);
-
- // Evaluate tactical threats, we need full attack info including king
- evaluate_threats<WHITE>(pos, ei);
- evaluate_threats<BLACK>(pos, ei);
+ bonus += evaluate_pieces_of_color<WHITE, HasPopCnt>(pos, ei, mobilityWhite)
+ - evaluate_pieces_of_color<BLACK, HasPopCnt>(pos, ei, mobilityBlack);