struct EvalInfo {
// Pointers to material and pawn hash table entries
- MaterialEntry* mi;
- PawnEntry* pi;
+ Material::Entry* mi;
+ Pawns::Entry* pi;
// attackedBy[color][piece type] is a bitboard representing all squares
// attacked by a given color and piece type, attackedBy[color][0] contains
template<bool Trace>
Value do_evaluate(const Position& pos, Value& margin) {
- assert(!pos.in_check());
+ assert(!pos.checkers());
EvalInfo ei;
Score score, mobilityWhite, mobilityBlack;
Key key = pos.key();
- Eval::Entry* e = pos.this_thread()->evalTable[key];
+ Thread* th = pos.this_thread();
+ Eval::Entry* e = th->evalTable[key];
// If e->key matches the position's hash key, it means that we have analysed
// this node before, and we can simply return the information we found the last
score = pos.psq_score() + (pos.side_to_move() == WHITE ? Tempo : -Tempo);
// Probe the material hash table
- ei.mi = pos.this_thread()->materialTable.probe(pos);
+ ei.mi = Material::probe(pos, th->materialTable, th->endgames);
score += ei.mi->material_value();
// If we have a specialized evaluation function for the current material
}
// Probe the pawn hash table
- ei.pi = pos.this_thread()->pawnTable.probe(pos);
+ ei.pi = Pawns::probe(pos, th->pawnsTable);
score += ei.pi->pawns_value();
// Initialize attack and king safety bitboards
// Opponent king cannot block because path is defended and position
// is not in check. So only friendly pieces can be blockers.
- assert(!pos.in_check());
+ assert(!pos.checkers());
assert((queeningPath & pos.pieces()) == (queeningPath & pos.pieces(c)));
// Add moves needed to free the path from friendly pieces and retest condition