/// to add further information in the future. A lookup to the pawn hash table
/// (performed by calling the get_pawn_info method in a PawnInfoTable object)
/// returns a pointer to a PawnInfo object.
/// to add further information in the future. A lookup to the pawn hash table
/// (performed by calling the get_pawn_info method in a PawnInfoTable object)
/// returns a pointer to a PawnInfo object.
Bitboard pawn_attacks(Color c) const;
Bitboard passed_pawns(Color c) const;
int file_is_half_open(Color c, File f) const;
int has_open_file_to_left(Color c, File f) const;
int has_open_file_to_right(Color c, File f) const;
Bitboard pawn_attacks(Color c) const;
Bitboard passed_pawns(Color c) const;
int file_is_half_open(Color c, File f) const;
int has_open_file_to_left(Color c, File f) const;
int has_open_file_to_right(Color c, File f) const;
-/// 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 {
- 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;
-
- PawnInfo* entries;
+ static Score evaluate_pawns(const Position& pos, Bitboard ourPawns, Bitboard theirPawns, PawnInfo* pi);
inline Bitboard PawnInfo::passed_pawns(Color c) const {
return passedPawns[c];
}
inline int PawnInfo::file_is_half_open(Color c, File f) const {
inline Bitboard PawnInfo::passed_pawns(Color c) const {
return passedPawns[c];
}
inline int PawnInfo::file_is_half_open(Color c, File f) const {
-inline Score PawnInfo::king_shelter(const Position& pos, Color c, Square ksq) {
- return kingSquares[c] == ksq ? kingShelters[c] : updateShelter(pos, c, ksq);
+template<Color Us>
+inline Score PawnInfo::king_shelter(const Position& pos, Square ksq) {
+ return kingSquares[Us] == ksq ? kingShelters[Us] : updateShelter<Us>(pos, ksq);