X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=907463d47d4ea2db4a7bfdc91268d4108c884ef8;hp=903b1b646e1a475dbdaebe7fdf86ac7a799bcd84;hb=2408243cf41ad7dfbd678c4d08756b17c342defc;hpb=f99cb3dc27719021e126690b7fd5aa5f43663ed8 diff --git a/src/position.h b/src/position.h index 903b1b64..907463d4 100644 --- a/src/position.h +++ b/src/position.h @@ -81,7 +81,7 @@ public: static void init(); // Text input/output - void set(const std::string& fen, bool isChess960, Thread* th); + void set(const std::string& fenStr, bool isChess960, Thread* th); const std::string fen() const; const std::string pretty(Move m = MOVE_NONE) const; @@ -108,7 +108,7 @@ public: // Checking Bitboard checkers() const; Bitboard discovered_check_candidates() const; - Bitboard pinned_pieces(Color toMove) const; + Bitboard pinned_pieces(Color c) const; // Attacks to/from a given square Bitboard attackers_to(Square s) const; @@ -174,7 +174,7 @@ private: // Helper functions void do_castling(Square kfrom, Square kto, Square rfrom, Square rto); - Bitboard hidden_checkers(Square ksq, Color c, Color toMove) const; + Bitboard hidden_checkers(Color c, Color kingColor) const; void put_piece(Square s, Color c, PieceType pt); void remove_piece(Square s, Color c, PieceType pt); void move_piece(Square from, Square to, Color c, PieceType pt); @@ -315,11 +315,11 @@ inline Bitboard Position::checkers() const { } inline Bitboard Position::discovered_check_candidates() const { - return hidden_checkers(king_square(~sideToMove), sideToMove, sideToMove); + return hidden_checkers(sideToMove, ~sideToMove); } -inline Bitboard Position::pinned_pieces(Color toMove) const { - return hidden_checkers(king_square(toMove), ~toMove, toMove); +inline Bitboard Position::pinned_pieces(Color c) const { + return hidden_checkers(c, c); } inline bool Position::pawn_passed(Color c, Square s) const {