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);
51#pragma GCC diagnostic pop
57#pragma GCC diagnostic push
58#pragma GCC diagnostic ignored "-Wswitch-enum"
70 for (
auto& v : m_whitePieces) v.clear();
71 for (
auto& v : m_blackPieces) v.clear();
73 for (
case_t iCase = 0; iCase < 64; ++iCase) {
116 m_boardData.s_boardData.whiteminor
121 m_boardData.s_boardData.blackminor
131#pragma GCC diagnostic pop
145 if (m_boardData.s_boardData.whiteminor && m_boardData.s_boardData.blackminor) {
147 if ((m_boardData.s_boardData.whiteminor + m_boardData.s_boardData.blackminor) < 4)
151 }
else if (m_boardData.s_boardData.whiteminor || m_boardData.s_boardData.blackminor) {
184 for (
column_t iCol = 0; iCol < 8; ++iCol) {
185 for (
rank_t iRank = 0; iRank < 4; ++iRank) {
238bBoard::operator std::string()
const
240 std::stringstream ss;
242 for (
rank_t iRank = 0; iRank < 8; ++iRank) {
243 ss <<
"+---+---+---+---+---+---+---+---+\n";
244 for (
column_t iCol = 0; iCol < 8; ++iCol) {
251 ss <<
"+---+---+---+---+---+---+---+---+\n";
254 << (
whiteToMove() ?
"White" :
"Black") <<
" to move"
258 for (uint8_t i = 0; i < 4; ++i) ss << (hasCastleRights(static_cast<uint8_t>(1 << i)) ?
"1" :
"-");
261 ss <<
" QS:" << (
isInCheck() ?
" Check" :
"")
274 os << bd.operator std::string() <<
"\n";
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 calcMinorPieces(bool const bForceRecalc)
Recalculate minor pieces, used for evaluation and end of game condition in case of less than 5 pieces...
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 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