-class PawnInfoTable {
-
- enum SideType { KingSide, QueenSide };
-
-public:
- PawnInfoTable(unsigned numOfEntries);
- ~PawnInfoTable();
- PawnInfo* get_pawn_info(const Position& pos) const;
-
-private:
- template<Color Us>
- Score evaluate_pawns(const Position& pos, Bitboard ourPawns, Bitboard theirPawns, PawnInfo* pi) const;
-
- template<Color Us, SideType Side>
- int evaluate_pawn_storm(Square s, Rank r, File f, Bitboard theirPawns) const;
-
- unsigned size;
- PawnInfo* entries;
-};
-
-
-////
-//// Inline functions
-////
-
-inline Score PawnInfo::pawns_value() const {
- return value;
-}
-
-inline Bitboard PawnInfo::passed_pawns() const {
- return passedPawns;
-}
-
-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 int PawnInfo::file_is_half_open(Color c, File f) const {
- return (halfOpenFiles[c] & (1 << int(f)));
-}
-
-inline int PawnInfo::has_open_file_to_left(Color c, File f) const {
- return halfOpenFiles[c] & ((1 << int(f)) - 1);
-}
-
-inline int PawnInfo::has_open_file_to_right(Color c, File f) const {
- return halfOpenFiles[c] & ~((1 << int(f+1)) - 1);
-}