X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=49935904bdc5b03afa2418bd342140a000861fe6;hp=5df07a092433c3dd1975102722840fb696a110fe;hb=e551afbab7767ddf79d33c24f8307a8cb291e3cd;hpb=d31f068312b88ca9a5a5d188898144cc80793635 diff --git a/src/position.cpp b/src/position.cpp index 5df07a09..49935904 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -450,19 +450,6 @@ const string Position::fen() const { } -/// Position::game_phase() calculates the game phase interpolating total non-pawn -/// material between endgame and midgame limits. - -Phase Position::game_phase() const { - - Value npm = st->nonPawnMaterial[WHITE] + st->nonPawnMaterial[BLACK]; - - npm = std::max(EndgameLimit, std::min(npm, MidgameLimit)); - - return Phase(((npm - EndgameLimit) * PHASE_MIDGAME) / (MidgameLimit - EndgameLimit)); -} - - /// Position::slider_blockers() returns a bitboard of all the pieces (both colors) /// that are blocking attacks on the square 's' from 'sliders'. A piece blocks a /// slider if removing that piece from the board would result in a position where