Use move_pawns() in Pawns::probe

And rename some stuff.

No functional change.
This commit is contained in:
Marco Costalba
2013-06-16 10:08:44 +02:00
parent 02420d4670
commit 1fd020a8ba
4 changed files with 37 additions and 35 deletions

View File

@@ -96,6 +96,18 @@ inline bool more_than_one(Bitboard b) {
}
/// shift_bb() moves bitboard one step along direction Delta. Mainly for pawns.
template<Square Delta>
inline Bitboard shift_bb(Bitboard b) {
return Delta == DELTA_N ? b << 8 : Delta == DELTA_S ? b >> 8
: Delta == DELTA_NE ? (b & ~FileHBB) << 9 : Delta == DELTA_SE ? (b & ~FileHBB) >> 7
: Delta == DELTA_NW ? (b & ~FileABB) << 7 : Delta == DELTA_SW ? (b & ~FileABB) >> 9
: 0;
}
/// rank_bb() and file_bb() take a file or a square as input and return
/// a bitboard representing all squares on the given file or rank.