]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Little timeman.cpp massage
[stockfish] / src / position.h
index 4854b29dcf876dcf64d98c08ff1e8cc69784c85d..9976eacb21826dafd57eed8d372fa22436e079c3 100644 (file)
@@ -270,6 +270,8 @@ public:
   // Number of plies since the last non-reversible move
   int rule_50_counter() const;
 
+  int startpos_ply_counter() const;
+
   // Other properties of the position
   bool opposite_colored_bishops() const;
   bool has_pawn_on_7th(Color c) const;
@@ -280,6 +282,8 @@ public:
   // Reset the gamePly variable to 0
   void reset_game_ply();
 
+  void inc_startpos_ply_counter();
+
   // Position consistency check, for debugging
   bool is_ok(int* failedStep = NULL) const;
 
@@ -334,6 +338,7 @@ private:
   int castleRightsMask[64];
   StateInfo startState;
   File initialKFile, initialKRFile, initialQRFile;
+  int startPosPlyCounter;
   int threadID;
   StateInfo* st;
 
@@ -364,7 +369,7 @@ inline PieceType Position::type_of_piece_on(Square s) const {
 }
 
 inline bool Position::square_is_empty(Square s) const {
-  return piece_on(s) == EMPTY;
+  return piece_on(s) == NO_PIECE;
 }
 
 inline bool Position::square_is_occupied(Square s) const {
@@ -536,11 +541,16 @@ inline int Position::rule_50_counter() const {
   return st->rule50;
 }
 
+inline int Position::startpos_ply_counter() const {
+
+  return startPosPlyCounter;
+}
+
 inline bool Position::opposite_colored_bishops() const {
 
   return   piece_count(WHITE, BISHOP) == 1
         && piece_count(BLACK, BISHOP) == 1
-        && square_color(piece_list(WHITE, BISHOP, 0)) != square_color(piece_list(BLACK, BISHOP, 0));
+        && !same_color_squares(piece_list(WHITE, BISHOP, 0), piece_list(BLACK, BISHOP, 0));
 }
 
 inline bool Position::has_pawn_on_7th(Color c) const {