X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=ea7f37c685dcfd98d74683829cfc67ee893210b2;hp=d6c79ee181840553b6858c6dcfcf5416898db506;hb=bc76c62c6302a445860e1deef5f55c2aabb7377d;hpb=2fe4e10b0bf11e98f66185c04084e87a1341af02 diff --git a/src/position.h b/src/position.h index d6c79ee1..ea7f37c6 100644 --- a/src/position.h +++ b/src/position.h @@ -166,8 +166,7 @@ public: void do_move(Move m, StateInfo& st); void do_move(Move m, StateInfo& st, const CheckInfo& ci, bool moveIsCheck); void undo_move(Move m); - void do_null_move(StateInfo& st); - void undo_null_move(); + template void do_null_move(StateInfo& st); // Static exchange evaluation int see(Move m) const; @@ -218,9 +217,7 @@ private: bool move_is_legal(const Move m) const; // Helper functions for doing and undoing moves - void do_capture_move(Key& key, PieceType capture, Color them, Square to, bool ep); - void do_castle_move(Move m); - void undo_castle_move(Move m); + template void do_castle_move(Move m); template Bitboard hidden_checkers() const; @@ -241,6 +238,7 @@ private: // Bitboards Bitboard byTypeBB[8]; // [pieceType] Bitboard byColorBB[2]; // [color] + Bitboard occupied; // Piece counts int pieceCount[2][8]; // [color][pieceType] @@ -290,11 +288,11 @@ inline Color Position::side_to_move() const { } inline Bitboard Position::occupied_squares() const { - return byTypeBB[0]; + return occupied; } inline Bitboard Position::empty_squares() const { - return ~byTypeBB[0]; + return ~occupied; } inline Bitboard Position::pieces(Color c) const {