19 std::ostringstream os;
21 << (
same ?
"=" :
"!") << (promotable ?
"p" :
"-");
26 std::ostringstream os;
28 << (
same ?
"=" :
"!");
44 assert(! diff.
zero());
50 return std::make_pair(p, cur);
52 assert(cur.isOnBoard());
54 return std::make_pair(p, cur);
69 if (p.second == move.
from())
76 std::ostringstream os;
92 std::ostringstream os;
100 self(s), attack(a), target(t)
114 }
else if (ap ==
BISHOP) {
120 }
else if (ap ==
ROOK) {
PatternLong(Direction d, Ptype s, LongTarget t)
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す ...
PatternLong2(Direction d, Ptype s, LongTarget2 t2)
constexpr Player alt(Player player)
const Piece findAttackAt(Player attack, Square target) const
return a piece s.t.
const std::string name() const
const std::string name() const
static const Piece EDGE()
static const PieceSquare find(const NumEffectState &state, Move move, Ptype attacker_ptype)
const Piece pieceAt(Square sq) const
const Piece pieceOnBoard(Square sq) const
static const Piece EMPTY()
Offset32Base< 8, 9 > Offset32
PatternBlock(Ptype s, Ptype a, LongTarget t)
const char * getCsaName(Ptype ptype) const
static const Direction INVALID
const PtypeTable Ptype_Table
bool isOnBoard() const
盤面上を表すかどうかの判定. 1<=x() && x()<=9 && 1<=y() && y()<=9 Squareの内部表現に依存する. ...
const Square from() const
static const PieceSquare find(const NumEffectState &state, Move move, Direction direction)
static const PieceSquare nextPieceOrEnd(const SimpleState &state, Square start, Player player, Direction direction)
direction方向に空白を進み、駒を探す
const Square square() const
const Offset getShortOffset(Offset32 offset32) const
Longの利きの可能性のあるoffsetの場合は, 反復に使う offsetを Shortの利きのoffsetの場合はそれ自身を返す...
std::pair< Piece, Square > PieceSquare
const std::string & name() const
const Offset getOffset(Direction dir) const
static const Square STAND()
static std::string name(int attack, int defense)
const BoardTable Board_Table