mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Account for gamePly after each move
Rename startPosPly to gamePly and increment/decrement the variable after each do/undo move. This adds a little overhead in do_move() but we will need to have the game ply during the search for the next patches now under test. Currently we don't increment gamePly in do_null_move() becuase it is not needed at the moment. Could change in the future. As a nice side effect we can now remove an hack in startpos_ply_counter(). No functional change.
This commit is contained in:
@@ -174,7 +174,7 @@ public:
|
||||
|
||||
// Other properties of the position
|
||||
Color side_to_move() const;
|
||||
int startpos_ply_counter() const;
|
||||
int game_ply() const;
|
||||
bool is_chess960() const;
|
||||
Thread* this_thread() const;
|
||||
int64_t nodes_searched() const;
|
||||
@@ -218,7 +218,7 @@ private:
|
||||
Bitboard castlePath[COLOR_NB][CASTLING_SIDE_NB];
|
||||
StateInfo startState;
|
||||
int64_t nodes;
|
||||
int startPosPly;
|
||||
int gamePly;
|
||||
Color sideToMove;
|
||||
Thread* thisThread;
|
||||
StateInfo* st;
|
||||
@@ -376,8 +376,8 @@ inline bool Position::is_passed_pawn_push(Move m) const {
|
||||
&& pawn_is_passed(sideToMove, to_sq(m));
|
||||
}
|
||||
|
||||
inline int Position::startpos_ply_counter() const {
|
||||
return startPosPly + st->pliesFromNull; // HACK
|
||||
inline int Position::game_ply() const {
|
||||
return gamePly;
|
||||
}
|
||||
|
||||
inline bool Position::opposite_bishops() const {
|
||||
|
||||
Reference in New Issue
Block a user