]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Move game phase computation to MaterialInfo
[stockfish] / src / position.h
index f6e49687de45c7b7bf2e5cb04ef61c5ff5ee9b5f..5539b7a6faa660da7897c7caf43d0b5d662102bf 100644 (file)
@@ -255,7 +255,6 @@ public:
   // Incremental evaluation
   Score value() const;
   Value non_pawn_material(Color c) const;
-  Phase game_phase() const;
   Score pst_delta(Piece piece, Square from, Square to) const;
 
   // Game termination checks
@@ -526,22 +525,6 @@ inline Value Position::non_pawn_material(Color c) const {
   return st->npMaterial[c];
 }
 
-inline Phase Position::game_phase() const {
-
-  // Values modified by Joona Kiiski
-  static const Value MidgameLimit = Value(15581);
-  static const Value EndgameLimit = Value(3998);
-
-  Value npm = non_pawn_material(WHITE) + non_pawn_material(BLACK);
-
-  if (npm >= MidgameLimit)
-      return PHASE_MIDGAME;
-  else if(npm <= EndgameLimit)
-      return PHASE_ENDGAME;
-  else
-      return Phase(((npm - EndgameLimit) * 128) / (MidgameLimit - EndgameLimit));
-}
-
 inline bool Position::move_is_passed_pawn_push(Move m) const {
 
   Color c = side_to_move();