1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Retire square_is_weak()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2011-06-28 16:25:44 +02:00
parent e0a00c4996
commit 31a0d2200c
3 changed files with 9 additions and 14 deletions

View file

@ -527,7 +527,8 @@ namespace {
score -= ThreatenedByPawnPenalty[Piece]; score -= ThreatenedByPawnPenalty[Piece];
// Bishop and knight outposts squares // Bishop and knight outposts squares
if ((Piece == BISHOP || Piece == KNIGHT) && pos.square_is_weak(s, Us)) if ( (Piece == BISHOP || Piece == KNIGHT)
&& !(pos.pieces(PAWN, Them) & attack_span_mask(Us, s)))
score += evaluate_outposts<Piece, Us>(pos, ei, s); score += evaluate_outposts<Piece, Us>(pos, ei, s);
// Queen or rook on 7th rank // Queen or rook on 7th rank

View file

@ -245,7 +245,7 @@ void Position::set_castling_rights(char token) {
Square sqH = relative_square(c, SQ_H1); Square sqH = relative_square(c, SQ_H1);
Square rsq, ksq = king_square(c); Square rsq, ksq = king_square(c);
token = toupper(token); token = char(toupper(token));
if (token == 'K') if (token == 'K')
for (rsq = sqH; piece_on(rsq) != make_piece(c, ROOK); rsq--) {} for (rsq = sqH; piece_on(rsq) != make_piece(c, ROOK); rsq--) {}

View file

@ -191,9 +191,6 @@ public:
// Information about pawns // Information about pawns
bool pawn_is_passed(Color c, Square s) const; bool pawn_is_passed(Color c, Square s) const;
// Weak squares
bool square_is_weak(Square s, Color c) const;
// Doing and undoing moves // Doing and undoing moves
void do_setup_move(Move m); void do_setup_move(Move m);
void do_move(Move m, StateInfo& st); void do_move(Move m, StateInfo& st);
@ -215,7 +212,7 @@ public:
// Incremental evaluation // Incremental evaluation
Score value() const; Score value() const;
Value non_pawn_material(Color c) 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 // Game termination checks
bool is_mate() const; bool is_mate() const;
@ -266,7 +263,7 @@ private:
Key compute_material_key() const; Key compute_material_key() const;
// Computing incremental evaluation scores and material counts // 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; Score compute_value() const;
Value compute_non_pawn_material(Color c) const; Value compute_non_pawn_material(Color c) const;
@ -417,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)); 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 { inline Key Position::get_key() const {
return st->key; return st->key;
} }
@ -437,11 +430,11 @@ inline Key Position::get_material_key() const {
return st->materialKey; return st->materialKey;
} }
inline Score Position::pst(Piece p, Square s) { inline Score Position::pst(Piece p, Square s) const {
return PieceSquareTable[p][s]; 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]; return PieceSquareTable[piece][to] - PieceSquareTable[piece][from];
} }
@ -466,7 +459,8 @@ inline int Position::full_moves() const {
inline bool Position::opposite_colored_bishops() const { inline bool Position::opposite_colored_bishops() const {
return piece_count(WHITE, BISHOP) == 1 && piece_count(BLACK, BISHOP) == 1 return piece_count(WHITE, BISHOP) == 1
&& piece_count(BLACK, BISHOP) == 1
&& opposite_color_squares(piece_list(WHITE, BISHOP)[0], piece_list(BLACK, BISHOP)[0]); && opposite_color_squares(piece_list(WHITE, BISHOP)[0], piece_list(BLACK, BISHOP)[0]);
} }