mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 12:47:08 +00:00
Move Attacks out of Bitboard File
Over the past few months our attacks and bitboard logic got a bit more involved and target specific, so I think it makes sense to split this up a bit more into separate files. While it's not in an ideal state I think it's first step and can be improved later, `pawn_attacks_bb` could also be moved into the attacks.h but this was more of an oversight from my side. closes https://github.com/official-stockfish/Stockfish/pull/6833 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
be9df38f27
commit
24d6398490
+4
-2
@@ -43,6 +43,8 @@ using std::string;
|
||||
|
||||
namespace Stockfish {
|
||||
|
||||
using namespace Attacks;
|
||||
|
||||
namespace Zobrist {
|
||||
|
||||
Key psq[PIECE_NB][SQUARE_NB];
|
||||
@@ -1216,11 +1218,11 @@ void Position::update_piece_threats(Piece pc,
|
||||
Square sliderSq = pop_lsb(sliders);
|
||||
Piece slider = piece_on(sliderSq);
|
||||
|
||||
const Bitboard ray = RayPassBB[sliderSq][s];
|
||||
const Bitboard ray = ray_pass_bb(sliderSq, s);
|
||||
const Bitboard discovered = ray & (rAttacks | bAttacks) & occupiedNoK;
|
||||
|
||||
assert(!more_than_one(discovered));
|
||||
if (discovered && (RayPassBB[sliderSq][s] & noRaysContaining) != noRaysContaining)
|
||||
if (discovered && (ray_pass_bb(sliderSq, s) & noRaysContaining) != noRaysContaining)
|
||||
{
|
||||
const Square threatenedSq = lsb(discovered);
|
||||
const Piece threatenedPc = piece_on(threatenedSq);
|
||||
|
||||
Reference in New Issue
Block a user