]> git.sesse.net Git - stockfish/blobdiff - src/material.h
Use operator() instead of apply() in endgames
[stockfish] / src / material.h
index c99320c6686c909581e1b19ed683c28863967d38..e33fc87bdf8c2ae8f590b64aba27b133c7ac7271 100644 (file)
 
 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 {