]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Use opposite_color_squares() instead of same_color_squares()
[stockfish] / src / position.h
index 4305759b0cf751c7cfa0f1eaaea3d90fffade9fa..3da25b6f57e4c6e54b8e62af18c84e9717d385ee 100644 (file)
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-
 #if !defined(POSITION_H_INCLUDED)
 #define POSITION_H_INCLUDED
 
-////
-//// Includes
-////
-
 #include "bitboard.h"
 #include "color.h"
 #include "move.h"
 #include "square.h"
 #include "value.h"
 
-
-////
-//// Constants
-////
-
 /// Maximum number of plies per game (220 should be enough, because the
 /// maximum search depth is 100, and during position setup we reset the
 /// move counter for every non-reversible move).
 const int MaxGameLength = 220;
 
-
-////
-//// Types
-////
-
 class Position;
 
 /// struct checkInfo is initialized at c'tor time and keeps
@@ -339,11 +324,6 @@ private:
   static const Value PieceValueEndgame[17];
 };
 
-
-////
-//// Inline functions
-////
-
 inline int64_t Position::nodes_searched() const {
   return nodes;
 }
@@ -538,9 +518,8 @@ inline int Position::startpos_ply_counter() const {
 
 inline bool Position::opposite_colored_bishops() const {
 
-  return   piece_count(WHITE, BISHOP) == 1
-        && piece_count(BLACK, BISHOP) == 1
-        && !same_color_squares(piece_list(WHITE, BISHOP, 0), piece_list(BLACK, BISHOP, 0));
+  return   piece_count(WHITE, BISHOP) == 1 && piece_count(BLACK, BISHOP) == 1
+        && opposite_color_squares(piece_list(WHITE, BISHOP, 0), piece_list(BLACK, BISHOP, 0));
 }
 
 inline bool Position::has_pawn_on_7th(Color c) const {