+ template<Color Us, GenType Type>
+ ExtMove* generate_all(const Position& pos, ExtMove* moveList, Bitboard target,
+ const CheckInfo* ci = nullptr) {
+
+ const bool Checks = Type == QUIET_CHECKS;
+
+ moveList = generate_pawn_moves<Us, Type>(pos, moveList, target, ci);
+ moveList = generate_moves<KNIGHT, Checks>(pos, moveList, Us, target, ci);
+ moveList = generate_moves<BISHOP, Checks>(pos, moveList, Us, target, ci);
+ moveList = generate_moves< ROOK, Checks>(pos, moveList, Us, target, ci);
+ moveList = generate_moves< QUEEN, Checks>(pos, moveList, Us, target, ci);
+
+ if (Type != QUIET_CHECKS && Type != EVASIONS)
+ {
+ Square ksq = pos.square<KING>(Us);
+ Bitboard b = pos.attacks_from<KING>(ksq) & target;
+ while (b)
+ *moveList++ = make_move(ksq, pop_lsb(&b));
+ }