- template<Color Us>
- MoveStack* generate_pawn_blocking_evasions(const Position&, Bitboard, Bitboard, MoveStack*);
-
- template<Color Us>
- MoveStack* generate_pawn_captures(const Position&, MoveStack*);
-
- template<Color Us, SquareDelta Diagonal>
- MoveStack* generate_pawn_captures_diagonal(MoveStack*, Bitboard, Bitboard, bool);
-
- template<Color Us, bool Checks>
- MoveStack* generate_pawn_noncaptures(const Position&, MoveStack*, Bitboard = EmptyBoardBB, Square = SQ_NONE);
-
- template<Color Us, SquareDelta Direction>
- inline Bitboard move_pawns(Bitboard p) {
-
- if (Direction == DELTA_N)
- return Us == WHITE ? p << 8 : p >> 8;
- else if (Direction == DELTA_NE)
- return Us == WHITE ? p << 9 : p >> 7;
- else if (Direction == DELTA_NW)
- return Us == WHITE ? p << 7 : p >> 9;
- else
- return p;
- }
-
- // Template generate_piece_checks() with specializations
- template<PieceType>
- MoveStack* generate_piece_checks(const Position&, MoveStack*, Color, Bitboard, Square);
-
- template<>
- inline MoveStack* generate_piece_checks<PAWN>(const Position& p, MoveStack* m, Color us, Bitboard dc, Square ksq) {
-
- return (us == WHITE ? generate_pawn_noncaptures<WHITE, true>(p, m, dc, ksq)
- : generate_pawn_noncaptures<BLACK, true>(p, m, dc, ksq));
- }