X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=36d8869598292e87b158c96e4c4d4a93dc3d2690;hp=e1bdf39e2b5bbbbf7c398016301672cebd17ab4a;hb=67338e6f322b8f8ec0d897815e16a87937efc9b0;hpb=81cd417b4584b0e3830940c5cb122c898afde08a diff --git a/src/position.h b/src/position.h index e1bdf39e..36d88695 100644 --- a/src/position.h +++ b/src/position.h @@ -1,7 +1,7 @@ /* Stockfish, a UCI chess playing engine derived from Glaurung 2.1 Copyright (C) 2004-2008 Tord Romstad (Glaurung author) - Copyright (C) 2008-2010 Marco Costalba, Joona Kiiski, Tord Romstad + Copyright (C) 2008-2012 Marco Costalba, Joona Kiiski, Tord Romstad Stockfish is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -173,10 +173,10 @@ public: int see_sign(Move m) const; // Accessing hash keys - Key get_key() const; - Key get_exclusion_key() const; - Key get_pawn_key() const; - Key get_material_key() const; + Key key() const; + Key exclusion_key() const; + Key pawn_key() const; + Key material_key() const; // Incremental evaluation Score value() const; @@ -278,7 +278,7 @@ inline Piece Position::piece_on(Square s) const { } inline bool Position::square_is_empty(Square s) const { - return board[s] == PIECE_NONE; + return board[s] == NO_PIECE; } inline Color Position::side_to_move() const { @@ -394,19 +394,19 @@ inline bool Position::pawn_is_passed(Color c, Square s) const { return !(pieces(PAWN, flip(c)) & passed_pawn_mask(c, s)); } -inline Key Position::get_key() const { +inline Key Position::key() const { return st->key; } -inline Key Position::get_exclusion_key() const { +inline Key Position::exclusion_key() const { return st->key ^ zobExclusion; } -inline Key Position::get_pawn_key() const { +inline Key Position::pawn_key() const { return st->pawnKey; } -inline Key Position::get_material_key() const { +inline Key Position::material_key() const { return st->materialKey; } @@ -428,8 +428,8 @@ inline Value Position::non_pawn_material(Color c) const { inline bool Position::is_passed_pawn_push(Move m) const { - return board[move_from(m)] == make_piece(sideToMove, PAWN) - && pawn_is_passed(sideToMove, move_to(m)); + return board[from_sq(m)] == make_piece(sideToMove, PAWN) + && pawn_is_passed(sideToMove, to_sq(m)); } inline int Position::startpos_ply_counter() const { @@ -454,14 +454,14 @@ inline bool Position::is_chess960() const { inline bool Position::is_capture_or_promotion(Move m) const { assert(is_ok(m)); - return is_special(m) ? !is_castle(m) : !square_is_empty(move_to(m)); + return is_special(m) ? !is_castle(m) : !square_is_empty(to_sq(m)); } inline bool Position::is_capture(Move m) const { // Note that castle is coded as "king captures the rook" assert(is_ok(m)); - return (!square_is_empty(move_to(m)) && !is_castle(m)) || is_enpassant(m); + return (!square_is_empty(to_sq(m)) && !is_castle(m)) || is_enpassant(m); } inline PieceType Position::captured_piece_type() const {