X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.h;h=e33fc87bdf8c2ae8f590b64aba27b133c7ac7271;hp=c99320c6686c909581e1b19ed683c28863967d38;hb=14df99130f53a2a5f57260eb830b4c0029bd4e99;hpb=fecefbb99cb0147f37d6895765a315f34c935786 diff --git a/src/material.h b/src/material.h index c99320c6..e33fc87b 100644 --- a/src/material.h +++ b/src/material.h @@ -27,6 +27,13 @@ const int MaterialTableSize = 8192; +/// Game phase +enum Phase { + PHASE_ENDGAME = 0, + PHASE_MIDGAME = 128 +}; + + /// MaterialInfo is a class which contains various information about a /// material configuration. It contains a material balance evaluation, /// a function pointer to a special endgame evaluation function (which in @@ -90,12 +97,12 @@ inline ScaleFactor MaterialInfo::scale_factor(const Position& pos, Color c) cons if (!scalingFunction[c]) return ScaleFactor(factor[c]); - ScaleFactor sf = scalingFunction[c]->apply(pos); + ScaleFactor sf = (*scalingFunction[c])(pos); return sf == SCALE_FACTOR_NONE ? ScaleFactor(factor[c]) : sf; } inline Value MaterialInfo::evaluate(const Position& pos) const { - return evaluationFunction->apply(pos); + return (*evaluationFunction)(pos); } inline Score MaterialInfo::material_value() const {