X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=e571048a2883d9404dcd9c3b7d7ba6dd93c012c9;hp=3d0ffb85d9d3c089d22dbde8951df4955f64f33c;hb=c3d2e6aba981ecc0caf82f81a1d44e8c4954e151;hpb=d490bb99734bd6e2f8a0a352d2f3f1ba264ece66 diff --git a/src/position.h b/src/position.h index 3d0ffb85..e571048a 100644 --- a/src/position.h +++ b/src/position.h @@ -90,6 +90,7 @@ public: Square ep_square() const; bool empty(Square s) const; template int count(Color c) const; + template int count() const; template const Square* squares(Color c) const; template Square square(Color c) const; @@ -154,6 +155,7 @@ public: int rule50_count() const; Score psq_score() const; Value non_pawn_material(Color c) const; + Value non_pawn_material() const; // Position consistency check, for debugging bool pos_is_ok(int* failedStep = nullptr) const; @@ -236,6 +238,10 @@ template inline int Position::count(Color c) const { return pieceCount[make_piece(c, Pt)]; } +template inline int Position::count() const { + return pieceCount[make_piece(WHITE, Pt)] + pieceCount[make_piece(BLACK, Pt)]; +} + template inline const Square* Position::squares(Color c) const { return pieceList[make_piece(c, Pt)]; } @@ -330,6 +336,10 @@ inline Value Position::non_pawn_material(Color c) const { return st->nonPawnMaterial[c]; } +inline Value Position::non_pawn_material() const { + return st->nonPawnMaterial[WHITE] + st->nonPawnMaterial[BLACK]; +} + inline int Position::game_ply() const { return gamePly; }