X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fendgame.cpp;h=0e70efe1d386fd387018d787be94acce38bc7d25;hb=0439a79566d03065317b2025b9b479b9ae9f2d65;hp=ec54d4e69ea5114265e0d47d05a4fd0cc68f2c4b;hpb=b46bf2950f76696fb965c79c5c95ffd7177268ac;p=stockfish diff --git a/src/endgame.cpp b/src/endgame.cpp index ec54d4e6..0e70efe1 100644 --- a/src/endgame.cpp +++ b/src/endgame.cpp @@ -116,10 +116,8 @@ Endgames::~Endgames() { template void Endgames::add(const string& code) { - typedef typename eg_family::type T; - - map((T*)0)[key(code, WHITE)] = new Endgame(WHITE); - map((T*)0)[key(code, BLACK)] = new Endgame(BLACK); + map((Endgame*)0)[key(code, WHITE)] = new Endgame(WHITE); + map((Endgame*)0)[key(code, BLACK)] = new Endgame(BLACK); } @@ -133,13 +131,13 @@ Value Endgame::operator()(const Position& pos) const { assert(pos.non_pawn_material(weakerSide) == VALUE_ZERO); assert(pos.piece_count(weakerSide, PAWN) == VALUE_ZERO); - // Stalemate detection with lone king + // Stalemate detection with lone king if ( pos.side_to_move() == weakerSide && !pos.in_check() && !MoveList(pos).size()) { return VALUE_DRAW; } - + Square winnerKSq = pos.king_square(strongerSide); Square loserKSq = pos.king_square(weakerSide); @@ -150,7 +148,7 @@ Value Endgame::operator()(const Position& pos) const { if ( pos.piece_count(strongerSide, QUEEN) || pos.piece_count(strongerSide, ROOK) - || pos.both_color_bishops(strongerSide)) { + || pos.bishop_pair(strongerSide)) { result += VALUE_KNOWN_WIN; }