]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Retire square_is_weak()
[stockfish] / src / position.h
index 9e4a6e4c3fba00c9b7b06ebda6687cdc50d01982..79406d5277dc6782e42434af955f2f34c54f18e5 100644 (file)
@@ -166,8 +166,7 @@ public:
   bool in_check() const;
 
   // Piece lists
-  Square piece_list(Color c, PieceType pt, int index) const;
-  const Square* piece_list_begin(Color c, PieceType pt) const;
+  const Square* piece_list(Color c, PieceType pt) const;
 
   // Information about attacks to or from a given square
   Bitboard attackers_to(Square s) const;
@@ -192,9 +191,6 @@ public:
   // Information about pawns
   bool pawn_is_passed(Color c, Square s) const;
 
-  // Weak squares
-  bool square_is_weak(Square s, Color c) const;
-
   // Doing and undoing moves
   void do_setup_move(Move m);
   void do_move(Move m, StateInfo& st);
@@ -216,7 +212,7 @@ public:
   // Incremental evaluation
   Score value() const;
   Value non_pawn_material(Color c) const;
-  static Score pst_delta(Piece piece, Square from, Square to);
+  Score pst_delta(Piece piece, Square from, Square to) const;
 
   // Game termination checks
   bool is_mate() const;
@@ -267,7 +263,7 @@ private:
   Key compute_material_key() const;
 
   // Computing incremental evaluation scores and material counts
-  static Score pst(Piece p, Square s);
+  Score pst(Piece p, Square s) const;
   Score compute_value() const;
   Value compute_non_pawn_material(Color c) const;
 
@@ -357,11 +353,7 @@ inline int Position::piece_count(Color c, PieceType pt) const {
   return pieceCount[c][pt];
 }
 
-inline Square Position::piece_list(Color c, PieceType pt, int idx) const {
-  return pieceList[c][pt][idx];
-}
-
-inline const Square* Position::piece_list_begin(Color c, PieceType pt) const {
+inline const Square* Position::piece_list(Color c, PieceType pt) const {
   return pieceList[c][pt];
 }
 
@@ -422,10 +414,6 @@ inline bool Position::pawn_is_passed(Color c, Square s) const {
   return !(pieces(PAWN, opposite_color(c)) & passed_pawn_mask(c, s));
 }
 
-inline bool Position::square_is_weak(Square s, Color c) const {
-  return !(pieces(PAWN, opposite_color(c)) & attack_span_mask(c, s));
-}
-
 inline Key Position::get_key() const {
   return st->key;
 }
@@ -442,11 +430,11 @@ inline Key Position::get_material_key() const {
   return st->materialKey;
 }
 
-inline Score Position::pst(Piece p, Square s) {
+inline Score Position::pst(Piece p, Square s) const {
   return PieceSquareTable[p][s];
 }
 
-inline Score Position::pst_delta(Piece piece, Square from, Square to) {
+inline Score Position::pst_delta(Piece piece, Square from, Square to) const {
   return PieceSquareTable[piece][to] - PieceSquareTable[piece][from];
 }
 
@@ -471,8 +459,9 @@ inline int Position::full_moves() const {
 
 inline bool Position::opposite_colored_bishops() const {
 
-  return   piece_count(WHITE, BISHOP) == 1 && piece_count(BLACK, BISHOP) == 1
-        && opposite_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 {