mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 19:16:49 +08:00
Rename piece_attacks_from() in attacks_from()
It is in line with attackers_to() and is shorter and piece is already redundant because is passed as template parameter anyway. Integrate also pawn_attacks_from() in the attacks_from() family so to have an uniform attack info API. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -303,7 +303,7 @@ PawnInfo* PawnInfoTable::get_pawn_info(const Position& pos) {
|
||||
if ( passed
|
||||
|| isolated
|
||||
|| chain
|
||||
|| (pos.pawn_attacks_from(s, us) & theirPawns)
|
||||
|| (pos.attacks_from<PAWN>(s, us) & theirPawns)
|
||||
|| (ourPawns & behind_bb(us, r) & neighboring_files_bb(f)))
|
||||
backward = false;
|
||||
else
|
||||
@@ -312,7 +312,7 @@ PawnInfo* PawnInfoTable::get_pawn_info(const Position& pos) {
|
||||
// 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_from(s, us);
|
||||
Bitboard b = pos.attacks_from<PAWN>(s, us);
|
||||
if (us == WHITE)
|
||||
{
|
||||
for ( ; !(b & (ourPawns | theirPawns)); b <<= 8);
|
||||
|
||||
Reference in New Issue
Block a user