X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fpawns.h;h=549aafa90b46c8290c80332af9e644edf0f6ee52;hb=d372f2e39a65e2b14fc0335841e652a9d208d3ec;hp=86708488cb276f6c13ce40d768d7bda7991d3485;hpb=85a7456bd7e8a1a01cdbfa8f4b6fb563d15a37c6;p=stockfish
diff --git a/src/pawns.h b/src/pawns.h
index 86708488..549aafa9 100644
--- a/src/pawns.h
+++ b/src/pawns.h
@@ -17,21 +17,13 @@
along with this program. If not, see .
*/
-
#if !defined(PAWNS_H_INCLUDED)
#define PAWNS_H_INCLUDED
-////
-//// Includes
-////
-
#include "bitboard.h"
#include "position.h"
-#include "value.h"
-
-////
-//// Types
-////
+#include "tt.h"
+#include "types.h"
const int PawnTableSize = 16384;
@@ -69,35 +61,26 @@ private:
Score kingShelters[2];
};
-/// The PawnInfoTable class represents a pawn hash table. It is basically
-/// just an array of PawnInfo objects and a few methods for accessing these
-/// objects. The most important method is get_pawn_info, which looks up a
-/// position in the table and returns a pointer to a PawnInfo object.
-class PawnInfoTable {
+/// The PawnInfoTable class represents a pawn hash table. The most important
+/// method is get_pawn_info, which returns a pointer to a PawnInfo object.
- enum SideType { KingSide, QueenSide };
+class PawnInfoTable : public SimpleHash {
- PawnInfoTable(const PawnInfoTable&);
- PawnInfoTable& operator=(const PawnInfoTable&);
+ enum SideType { KingSide, QueenSide };
public:
- PawnInfoTable();
- ~PawnInfoTable();
PawnInfo* get_pawn_info(const Position& pos) const;
void prefetch(Key key) const;
private:
template
Score evaluate_pawns(const Position& pos, Bitboard ourPawns, Bitboard theirPawns, PawnInfo* pi) const;
-
- PawnInfo* entries;
};
-
-////
-//// Inline functions
-////
+inline Square pawn_push(Color c) {
+ return c == WHITE ? DELTA_N : DELTA_S;
+}
inline void PawnInfoTable::prefetch(Key key) const {