13#pragma GCC diagnostic push
14#pragma GCC diagnostic ignored "-Weffc++"
22 , m_boardData{b.m_boardData.u_boardData}
33 , m_boardData{b.m_boardData.u_boardData}
36 m_previousmoves.emplace_back(m);
53#pragma GCC diagnostic pop
59#pragma GCC diagnostic push
60#pragma GCC diagnostic ignored "-Wswitch-enum"
72 for (
auto& v : m_whitePieces) v.clear();
73 for (
auto& v : m_blackPieces) v.clear();
75 for (
case_t iCase = 0; iCase < 64; ++iCase) {
118 m_boardData.s_boardData.whiteminor
123 m_boardData.s_boardData.blackminor
133#pragma GCC diagnostic pop
147 if (m_boardData.s_boardData.whiteminor && m_boardData.s_boardData.blackminor) {
149 if ((m_boardData.s_boardData.whiteminor + m_boardData.s_boardData.blackminor) < 4)
153 }
else if (m_boardData.s_boardData.whiteminor || m_boardData.s_boardData.blackminor) {
169 std::string sStage =
"";
186 for (
column_t iCol = 0; iCol < 8; ++iCol) {
187 for (
rank_t iRank = 0; iRank < 4; ++iRank) {
240bBoard::operator std::string()
const
242 std::stringstream ss;
244 for (
rank_t iRank = 0; iRank < 8; ++iRank) {
245 ss <<
"+---+---+---+---+---+---+---+---+\n";
246 for (
column_t iCol = 0; iCol < 8; ++iCol) {
253 ss <<
"+---+---+---+---+---+---+---+---+\n";
256 << (
whiteToMove() ?
"White" :
"Black") <<
" to move"
260 for (uint8_t i = 0; i < 4; ++i) ss << (hasCastleRights(static_cast<uint8_t>(1 << i)) ?
"1" :
"-");
263 ss <<
" QS:" << (
isInCheck() ?
" Check" :
"")
276 os << bd.operator std::string();
union boardInfo boardInfo_t
This is the main include file, needs to be included before any other include.
std::ostream & operator<<(std::ostream &os, bBoard const &bd)
print board
constexpr piece_t getPiece(case_t const cf) const
constexpr bool isNonSilent() const
constexpr bool whiteToMove() const
constexpr int16_t getMoveNumber() const
constexpr bool hasCastleRights(uint8_t const f) const
virtual boardInfo_t applyMove(bMove const &m)
play game move on board
constexpr case_t getEp() const
constexpr bool isEpSet() const
constexpr int8_t pieceCount() const
void calcHash()
Set hash based on board position, also calc pieces Byte 0: bits 4-6 capture count (masked) bit 7 play...
constexpr bool isInCheck() const
void setCastleRights(uint8_t const f)
void setPieceKU(case_t const cf, piece_t const piece)
constexpr piece_t getCapturedPiece() const
constexpr fromto_t getFromTo() const
void setNeedCalcMinorPieces()
void invertColours()
invert colours update kingpos, update colour to move, castle rights, ...
void setVariation(bBoard const &chldbrd)
boardInfo_t applyMove(bMove const &m) override
modification of board move is kept on previous board newboard does not have move stored and has flag ...
void calcMinorPieces(bool const bForceRecalc=false)
Recalculate minor pieces, used for evaluation and end of game condition in case of less than 5 pieces...
void clearNeedCalcMinorPieces()
constexpr bool noNeedCalcMinorPieces() const
bBoard(bBoard const &b)
Copy board with limited board data, no board history.
void setMove(bmove_t const bmt)
movesequence_t const & getPreviousMoves() const
movesequence_t const & getVariation() const
std::string getGameStageName() const
void calcGameStage()
calculate stage of game to assist in evaluation
constexpr bGameStage getGameStage() const
position on board, defined as 255 if invalid used primarily to compose a move or a source or destinat...
static constexpr case_t coordToCase(column_t const c, rank_t const r)
static cpiece_t getPieceChar(piece_t const piece)
static class member function