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