mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Move game_phase() to material.cpp
For some reason, although game phase is used only in material, it is computed in Position. Move computation to material, where it belongs, and remove the useless call chain. No functional change.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user