19 explicit bFen(std::string
const& fs);
28 operator std::string()
const;
54 int16_t
getPly()
const {
return m_ply; }
55 void setPly(int16_t
const p) { m_ply = p; }
63 void setCastle(uint8_t
const f,
bool const c);
70 return static_cast<side_t>((m_ply & 0x0001) + 1); }
99 uint8_t m_castling = 0;
102 std::array<piece_t, 64> m_fields;
105 int16_t m_ply50moves = 0;
125 void delayed_ctor(
bool const& needMaterialUpdate =
true);
127 operator std::string()
const;
140 void setInCheck() { m_bInCheck =
true; m_bNonSilent =
true; }
141 bool isMate()
const {
return m_bIsMate; }
176 void applyMove(
bMove const& m);
177 void applyWhiteMove(
bMove const& m);
178 void applyBlackMove(
bMove const& m);
182 void calcGameStage();
184 bool m_fullyinitialised =
false;
186 uint8_t m_piecesonboard = 0;
189 std::array<caselist_t ,tStatPiece::STAT_SIZE> m_whitePieces;
190 std::array<caselist_t ,tStatPiece::STAT_SIZE> m_blackPieces;
193 uint8_t m_whiteminor = 0;
194 uint8_t m_blackminor = 0;
196 case_t m_capturedcase = 0;
197 bool m_bNonSilent =
false;
198 bool m_bInCheck =
false;
199 bool m_bIsMate =
false;
201 bool m_castledoneWhite;
202 bool m_castledoneBlack;
unsigned long long hashkey_t
uint_fast16_t movenum_t
moveflags (high order word) & basicmove (low order word)
int_fast16_t bScore
used to return id of move in movelist
uint32_t move_t
moveflags: bitfield
std::vector< move_t > movesequence_t
void setPiece(case_t const bc, piece_t const piece)
used for promotion move generation only
bBasicBoard & operator=(bBasicBoard &&)=delete
bool canCastle(uint8_t const f) const
void setCastle(uint8_t const f, bool const c)
piece_t getPiece(case_t const bc) const
1 for white, 2 for black
int16_t getMoveNumber() const
bBasicBoard(bBasicBoard const &)=default
hashkey_t getHash() const
calculate and set hash
void setEp(case_t const e)
void movePiece(case_t const f, case_t const t, piece_t const p)
void moveBlackKing(case_t const f, case_t const t)
side_t getColourToMove() const
std::string getHashStr() const
void setPieceKU(case_t const bc, piece_t const piece)
used for setboard only
void moveWhiteKing(case_t const f, case_t const t)
case_t getBlackKingPos() const
virtual void setCapture(piece_t const p, case_t const c)
Clear castle flag if rook captured update piece counter, update hash, clear field.
bBasicBoard(bBasicBoard &&)=default
void setPly(int16_t const p)
case_t getWhiteKingPos() const
void swapPiece(case_t const t, piece_t const op, piece_t const np)
void calcHash()
Set hash based on board position, also calc pieces Byte 0: bits 4-6 capture count (masked) bit 7 play...
int16_t getPly50Moves() const
bBasicBoard & operator=(bBasicBoard const &)=delete
void setPly50Moves(int16_t const p)
piece_t getPieceCtl(column_t const iColumn, rank_t const iRank) const
retrieve piece with bounds checking, return field empty in case of out of bounds
void clearCastle(uint8_t const f)
bool isFieldEmpty(case_t const bc) const
void setCapture(piece_t const p, case_t const c) override
set non-silent flag, store captured piece and case (for undo)
void setCastleDoneWhite(bool const c)
bBoard & operator=(bBoard &&)=delete
uint8_t getPiecesOnBoard() const
movenum_t generateMoves()
generate moves if not yet generated
void clearPreviousMoves()
bBoard(bBoard &&b) noexcept
Push board on gamestack.
bGameStage getStage() const
movesequence_t getVariation() const
move_t getMovePlayed() const
void setVariation(bBoard const &chldbrd)
movesequence_t getPreviousMoves() const
friend std::ostream & operator<<(std::ostream &os, bBoard const &dt)
print board
bool castleDoneWhite() const
-1 black to move, 1 white to move
void setBoardEvaluation(bScore const s)
void setCastleDoneBlack(bool const c)
bool castleDoneBlack() const
movenum_t getNumberOfMoves() const
bMoveList & getMoves()
return moves in position, initialise structure if needed
bScore minimizing() const
bScore getBoardEvaluation() const
bScore getMaterialEvaluation() const
void delayed_ctor(bool const &needMaterialUpdate=true)
do full initialisation
movenum_t generateAtLeastOneQSMove()
movenum_t generateAtLeastOneMove()
see if at least one move can be played e.g.
void invert()
invert board position update kingpos, update colour to move, castle rights, ...
bBoard(bBoard const &)=delete
bBoard & operator=(bBoard const &)=delete
bFen & operator=(bFen const &)=delete
bFen(std::string const &fs)
bFen & operator=(bFen &&)=delete
bFen(bFen const &)=delete
friend std::ostream & operator<<(std::ostream &os, bFen const &f)
game representation, singleton
constexpr bScore SCORE_UNDEFINED