]> git.sesse.net Git - stockfish/blobdiff - src/pawns.h
Update History and Counter move on TT hit
[stockfish] / src / pawns.h
index 7292606b8451b95a06716bc65a6157a7668d1971..fed90b703bd2901fd56acf476ff9907627c342a0 100644 (file)
@@ -27,7 +27,7 @@
 namespace Pawns {
 
 /// Pawns::Entry contains various information about a pawn structure. Currently,
-/// it only includes a middle game and end game pawn structure evaluation, and a
+/// it only includes a middlegame and endgame pawn structure evaluation, and a
 /// bitboard of passed pawns. We may want to add further information in the future.
 /// A lookup to the pawn hash table (performed by calling the probe function)
 /// returns a pointer to an Entry object.
@@ -37,7 +37,8 @@ struct Entry {
   Score pawns_value() const { return value; }
   Bitboard pawn_attacks(Color c) const { return pawnAttacks[c]; }
   Bitboard passed_pawns(Color c) const { return passedPawns[c]; }
-  int pawns_on_same_color_squares(Color c, Square s) const { return pawnsOnSquares[c][!!(BlackSquares & s)]; }
+  Bitboard candidate_pawns(Color c) const { return candidatePawns[c]; }
+  int pawns_on_same_color_squares(Color c, Square s) const { return pawnsOnSquares[c][!!(DarkSquares & s)]; }
   int semiopen(Color c, File f) const { return semiopenFiles[c] & (1 << int(f)); }
   int semiopen_on_side(Color c, File f, bool left) const {
 
@@ -47,7 +48,7 @@ struct Entry {
   template<Color Us>
   Score king_safety(const Position& pos, Square ksq)  {
 
-    return kingSquares[Us] == ksq && castleRights[Us] == pos.can_castle(Us)
+    return kingSquares[Us] == ksq && castlingFlags[Us] == pos.can_castle(Us)
          ? kingSafety[Us] : update_safety<Us>(pos, ksq);
   }
 
@@ -59,10 +60,11 @@ struct Entry {
 
   Key key;
   Bitboard passedPawns[COLOR_NB];
+  Bitboard candidatePawns[COLOR_NB];
   Bitboard pawnAttacks[COLOR_NB];
   Square kingSquares[COLOR_NB];
   int minKPdistance[COLOR_NB];
-  int castleRights[COLOR_NB];
+  int castlingFlags[COLOR_NB];
   Score value;
   int semiopenFiles[COLOR_NB];
   Score kingSafety[COLOR_NB];
@@ -71,6 +73,7 @@ struct Entry {
 
 typedef HashTable<Entry, 16384> Table;
 
+void init();
 Entry* probe(const Position& pos, Table& entries);
 
 }