29 std::sort(pieces.begin(), pieces.end());
41 if (src.size() !=
data.size())
42 throw std::runtime_error(
"bad argument in MiniBoardChar50::MiniBoardChar50(const std::string&)");
43 std::copy(src.begin(), src.end(),
data.begin());
56 const bool promoted = (
data[40+i/8+5] >> (i%8)) & 1;
60 state.
setPiece(owner, position, ptype);
66 assert(state.
turn() == turn);
73 return std::string(
data.begin(),
data.end());
bool isPromoted() const
promoteした駒かどうかをチェックする
const Square square() const
void setTurn(Player player)
const Piece pieceOf(int num) const
void setPiece(Player player, Square sq, Ptype ptype)
const SimpleState rotate180() const
const std::string toString() const
CArray< uint8_t, 50 > data
const SimpleState toSimpleState(Player turn=BLACK) const
static Square bits2Square(const int bit_position)
Converts an integer (bits) to Square.
static int position2Bits(const Square &pos)
Converts a position to an integer (bits).
bool operator<(const MiniBoardChar50 &, const MiniBoardChar50 &)
bool operator==(const CompactBoard &, const CompactBoard &)
局面を比較する.
const PtypeTable Ptype_Table
const PieceTable Piece_Table
constexpr Player indexToPlayer(int n)
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す
constexpr int playerToIndex(Player player)
Ptype promote(Ptype ptype)
promote可能なptypeに対して,promote後の型を返す promote不可のptypeを与えてはいけない.