- case CAPTURES:
- target = pos.pieces(~Us);
- break;
- case QUIETS:
- case QUIET_CHECKS:
- target = ~pos.pieces();
- break;
- case EVASIONS:
- target = between_bb(ksq, lsb(pos.checkers()));
- break;
- case NON_EVASIONS:
- target = ~pos.pieces(Us);
- break;
+ target = Type == EVASIONS ? between_bb(ksq, lsb(pos.checkers()))
+ : Type == NON_EVASIONS ? ~pos.pieces( Us)
+ : Type == CAPTURES ? pos.pieces(~Us)
+ : ~pos.pieces( ); // QUIETS || QUIET_CHECKS
+
+ moveList = generate_pawn_moves<Us, Type>(pos, moveList, target);
+ moveList = generate_moves<Us, KNIGHT, Checks>(pos, moveList, target);
+ moveList = generate_moves<Us, BISHOP, Checks>(pos, moveList, target);
+ moveList = generate_moves<Us, ROOK, Checks>(pos, moveList, target);
+ moveList = generate_moves<Us, QUEEN, Checks>(pos, moveList, target);