- template<PieceType Piece>
- MoveStack* generate_piece_blocking_evasions(const Position& pos, MoveStack* mlist, Color us,
- Bitboard not_pinned, Bitboard blockSquares) {
-
- Bitboard b = pos.pieces_of_color_and_type(us, Piece) & not_pinned;
- while (b)
- {
- Square from = pop_1st_bit(&b);
- Bitboard bb = pos.piece_attacks<Piece>(from) & blockSquares;
- SERIALIZE_MOVES(bb);
- }
- return mlist;
- }
-
- template<>
- MoveStack* generate_piece_blocking_evasions<PAWN>(const Position& p, MoveStack* m, Color us,
- Bitboard np, Bitboard bs) {
- if (us == WHITE)
- return do_generate_pawn_blocking_evasions<WHITE, RANK_8, Rank3BB, DELTA_N>(p, np, bs, m);
- else
- return do_generate_pawn_blocking_evasions<BLACK, RANK_1, Rank6BB, DELTA_S>(p, np, bs, m);
- }
-