- else if (Type == QUIETS)
- target = ~pos.pieces();
-
- else if (Type == NON_EVASIONS)
- target = ~pos.pieces(us);
-
- mlist = (us == WHITE ? generate_pawn_moves<WHITE, Type>(pos, mlist, target)
- : generate_pawn_moves<BLACK, Type>(pos, mlist, target));
-
- mlist = generate_moves<KNIGHT>(pos, mlist, us, target);
- mlist = generate_moves<BISHOP>(pos, mlist, us, target);
- mlist = generate_moves<ROOK>(pos, mlist, us, target);
- mlist = generate_moves<QUEEN>(pos, mlist, us, target);
- mlist = generate_moves<KING>(pos, mlist, us, target);
-
- if (Type != CAPTURES && pos.can_castle(us))
- {
- mlist = generate_castle<KING_SIDE, false>(pos, mlist, us);
- mlist = generate_castle<QUEEN_SIDE, false>(pos, mlist, us);
- }
-
- return mlist;
+ return us == WHITE ? generate_all<WHITE, Type>(pos, moveList, target)
+ : generate_all<BLACK, Type>(pos, moveList, target);