X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.h;h=549aafa90b46c8290c80332af9e644edf0f6ee52;hp=76a98566b7570ba1046a003279fb5947de07ccda;hb=0fcda095df1caa860e8e3f3a714d5545ec9dc122;hpb=2a2353aac65d6f7263081dc373c768c8717602db
diff --git a/src/pawns.h b/src/pawns.h
index 76a98566..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;
@@ -47,8 +39,6 @@ class PawnInfo {
public:
Score pawns_value() const;
- Value kingside_storm_value(Color c) const;
- Value queenside_storm_value(Color c) const;
Bitboard pawn_attacks(Color c) const;
Bitboard passed_pawns(Color c) const;
int file_is_half_open(Color c, File f) const;
@@ -67,41 +57,30 @@ private:
Bitboard pawnAttacks[2];
Square kingSquares[2];
Score value;
- int ksStormValue[2];
- int qsStormValue[2];
int halfOpenFiles[2];
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.
+
+class PawnInfoTable : public SimpleHash {
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;
-
- template
- int evaluate_pawn_storm(Square s, Rank r, File f, Bitboard theirPawns) 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 {
@@ -118,14 +97,6 @@ inline Bitboard PawnInfo::pawn_attacks(Color c) const {
return pawnAttacks[c];
}
-inline Value PawnInfo::kingside_storm_value(Color c) const {
- return Value(ksStormValue[c]);
-}
-
-inline Value PawnInfo::queenside_storm_value(Color c) const {
- return Value(qsStormValue[c]);
-}
-
inline Bitboard PawnInfo::passed_pawns(Color c) const {
return passedPawns[c];
}