X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=e1bdf39e2b5bbbbf7c398016301672cebd17ab4a;hp=7842ed8b337254ea5d2db61f537644056146e212;hb=d543a64cc7fc06daed275b332b10ea06ba738001;hpb=29be28e1a24898cec64470332740eaa54893b7a4 diff --git a/src/position.h b/src/position.h index 7842ed8b..e1bdf39e 100644 --- a/src/position.h +++ b/src/position.h @@ -23,20 +23,20 @@ #include #include "bitboard.h" -#include "move.h" #include "types.h" /// The checkInfo struct is initialized at c'tor time and keeps info used /// to detect if a move gives check. +class Position; struct CheckInfo { - explicit CheckInfo(const Position&); + explicit CheckInfo(const Position&); - Bitboard dcCandidates; - Bitboard pinned; - Bitboard checkSq[8]; + Bitboard dcCandidates; + Bitboard pinned; + Bitboard checkSq[8]; }; @@ -44,7 +44,6 @@ struct CheckInfo { /// object to its previous state when we retract a move. Whenever a move /// is made on the board (by calling Position::do_move), an StateInfo object /// must be passed as a parameter. -class Position; struct StateInfo { Key pawnKey, materialKey; @@ -84,16 +83,17 @@ struct StateInfo { class Position { - // No defaul, copy c'tor or assignment allowed, default c'tor will not be - // generated anyhow because of user-defined c'tors. + // No copy c'tor or assignment operator allowed Position(const Position&); Position& operator=(const Position&); public: - Position(const Position& pos, int threadID); - Position(const std::string& fen, bool isChess960, int threadID); + Position() {} + Position(const Position& pos, int th) { copy(pos, th); } + Position(const std::string& fen, bool isChess960, int th); // Text input/output + void copy(const Position& pos, int th); void from_fen(const std::string& fen, bool isChess960); const std::string to_fen() const; void print(Move m = MOVE_NONE) const;