for (Color us = WHITE; us <= BLACK; us++)
{
Color them = opposite_color(us);
- Bitboard ourPawns = pos.pawns(us);
- Bitboard theirPawns = pos.pawns(them);
+ Bitboard ourPawns = pos.pieces(PAWN, us);
+ Bitboard theirPawns = pos.pieces(PAWN, them);
Bitboard pawns = ourPawns;
// Initialize pawn storm scores by giving bonuses for open files
if ( passed
|| isolated
|| chain
- || (pos.pawn_attacks(us, s) & theirPawns)
+ || (pos.pawn_attacks(s, us) & theirPawns)
|| (ourPawns & behind_bb(us, r) & neighboring_files_bb(f)))
backward = false;
else
// pawn on neighboring files. We now check whether the pawn is
// backward by looking in the forward direction on the neighboring
// files, and seeing whether we meet a friendly or an enemy pawn first.
- Bitboard b = pos.pawn_attacks(us, s);
+ Bitboard b = pos.pawn_attacks(s, us);
if (us == WHITE)
{
for ( ; !(b & (ourPawns | theirPawns)); b <<= 8);
int PawnInfo::updateShelter(const Position& pos, Color c, Square ksq) {
unsigned shelter = 0;
- Bitboard pawns = pos.pawns(c) & this_and_neighboring_files_bb(ksq);
+ Bitboard pawns = pos.pieces(PAWN, c) & this_and_neighboring_files_bb(ksq);
unsigned r = ksq & (7 << 3);
for (int i = 1, k = (c ? -8 : 8); i < 4; i++)
{