X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fendgame.cpp;h=05de131fb2b26deff9336ddc2137db701752d56e;hb=4a0db9ea3c34d7663a039c40ce810ba9cb743cca;hp=db67ce95cf92923b012cfeb31b3ef28560f16771;hpb=d9cac9a41492c3e54f3bb471606ec3a922a8ea0f;p=stockfish diff --git a/src/endgame.cpp b/src/endgame.cpp index db67ce95..05de131f 100644 --- a/src/endgame.cpp +++ b/src/endgame.cpp @@ -86,30 +86,6 @@ namespace { } // namespace -/// Endgames members definitions - -Endgames::Endgames() { - - add("KPK"); - add("KNNK"); - add("KBNK"); - add("KRKP"); - add("KRKB"); - add("KRKN"); - add("KQKP"); - add("KQKR"); - - add("KNPK"); - add("KNPKB"); - add("KRPKR"); - add("KRPKB"); - add("KBPKB"); - add("KBPKN"); - add("KBPPKB"); - add("KRPPKRP"); -} - - /// Mate with KX vs K. This function is used to evaluate positions with /// king and plenty of material vs a lone king. It simply gives the /// attacking side a bonus for driving the defending king towards the edge @@ -214,7 +190,7 @@ Value Endgame::operator()(const Position& pos) const { Value result; // If the stronger side's king is in front of the pawn, it's a win - if (wksq < psq && file_of(wksq) == file_of(psq)) + if (forward_file_bb(WHITE, wksq) & psq) result = RookValueEg - distance(wksq, psq); // If the weaker side's king is too far from the pawn and the rook, @@ -240,7 +216,7 @@ Value Endgame::operator()(const Position& pos) const { } -/// KR vs KB. This is very simple, and always returns drawish scores. The +/// KR vs KB. This is very simple, and always returns drawish scores. The /// score is slightly bigger when the defending king is close to the edge. template<> Value Endgame::operator()(const Position& pos) const {