21 for (
movenum_t moveid = 1; moveid <= n_moves; moveid++) {
23 ctor(b,
bMove(ml[moveid]));
31 , m_evalstr{m.m_evalstr}
64 for (
movenum_t moveid = 1; moveid <= n_moves; moveid++) {
66 if (bm.
to() == m.
to()) {
68 && (bs.getPiece(bm.
from()) == bs.getPiece(m.
from()))) {
70 siblings.emplace_back(bm);
76 alternatives = getSiblings(b);
81 m_move = (
bCase(m.
from()).operator std::string()).substr(0,1);
87 m_move +=
bCase(m.
to()).operator std::string();
94 if (alternatives.size() > 0) {
97 if (std::none_of(alternatives.begin(), alternatives.end(),
99 { return bm.fromcolumn() == m.fromcolumn(); })) {
101 m_move.insert(1, (
bCase(m.
from()).operator std::string()).substr(0, 1));
102 }
else if (std::none_of(alternatives.begin(), alternatives.end(),
104 { return bm.fromrank() == m.fromrank(); })) {
106 m_move.insert(1, (
bCase(m.
from()).operator std::string()).substr(1, 1));
109 m_move.insert(1, (
bCase(m.
from()).operator std::string()));
122 if (!m_move.size())
throw std::logic_error(
"empty bPgnMove");
134std::string
const bPgnMove::getPromotionDecorationStr(
ppiece_t const piece)
146 throw std::logic_error(
"superfluous call to bPgnMove::getPromotionDecorationStr");
153 if (lhs.m_move == rhs)
return true;
175 for (
movenum_t moveid = 1; moveid <= n_moves; moveid++) {
176 m_pmoves.emplace_back(b, ml[moveid]);
187 os <<
"#" << belofte::to_string(
static_cast<int64_t
>(mpl.m_pmoves.size())) <<
" ";
188 for (
bPgnMove const& m: mpl.m_pmoves) {
This is the main include file, needs to be included before any other include.
piece_t getPiece(case_t const bc) const
1 for white, 2 for black
MEMBER_CONSTEXPR case_t to() const
MEMBER_CONSTEXPR case_t from() const
ppiece_t getPromotion() const
bMoveList & getMoveListRef()
return reference to movelist
position on board, defined as 255 if invalid used primarily to compose a move or a source or destinat...
bool isCastleMove() const
std::string getMoveEvalStr() const
bool isEndOfGame() const
Flag if mated.
bool isLongCastleMove() const
movenum_t getNumberOfMoves() const
movenum_t generateMoves(bBoard const &b)
generate moves if not yet generated
basicmove_t getMoveT(movenum_t const moveid) const
PgnMove is for user-interface only.
bPgnMove(bPgnMove const &m)
static const std::string getPieceStrUpper(piece_t const piece)
static class member function
constexpr bScore SCORE_POSITIVE
constexpr bScore SCORE_THEORETIC_DRAW
std::vector< bMove > movelist_t
bool operator==(bPgnMove const &lhs, std::string const &rhs)
std::ostream & operator<<(std::ostream &os, bPgnMove const &m)