X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fposition.h;h=e3749cdb4f6fd50deabff8b5d12b5446be90fc47;hb=6b6f3c4ca47cdb39bea9f9b39b5f8ed80f5198a9;hp=be43c2e41e2bf13c2926f2a163f54725726f9cae;hpb=35782079749c8f16560a13b9740d1a76654c6fe2;p=stockfish diff --git a/src/position.h b/src/position.h index be43c2e4..e3749cdb 100644 --- a/src/position.h +++ b/src/position.h @@ -51,7 +51,7 @@ //// /// FEN string for the initial position -const std::string StartPosition = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"; +const std::string StartPositionFEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"; /// Maximum number of plies per game (220 should be enough, because the /// maximum search depth is 100, and during position setup we reset the @@ -294,6 +294,7 @@ private: void put_piece(Piece p, Square s); void allow_oo(Color c); void allow_ooo(Color c); + bool set_castling_rights(char token); // Helper functions for doing and undoing moves void do_capture_move(Key& key, PieceType capture, Color them, Square to, bool ep); @@ -363,7 +364,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 { @@ -539,7 +540,7 @@ 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 {