Go to the documentation of this file.
3 #ifndef _PATTERNLONG2_H
4 #define _PATTERNLONG2_H
46 if (move.
ptype() !=
self)
76 if (p.first.ptype() !=
target)
84 if (! p.first.isPiece())
86 return same == (p.first.owner() == move.
player());
90 if (p.first.ptype() !=
target)
96 if (! p.first.isPiece())
98 return same == (p.first.owner() == move.
player());
100 const std::string
name()
const;
119 const std::string
name()
const;
142 if (move.
ptype() !=
self)
166 if (move.
ptype() !=
self)
182 if (move.
ptype() !=
self)
186 && pp.second.canPromote(pp.first.isPiece() ?
alt(pp.first.owner()) :
alt(move.
player()))
const Piece pieceAt(Square sq) const
LongTarget2(Ptype t, bool s)
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)
PatternLong2(Direction d, Ptype s, LongTarget2 t2)
const std::string name() const
static const Piece EMPTY()
static const Piece find(const NumEffectState &state, Move move, Direction direction)
const std::string & name() const
Piece nextPiece(Square cur, Offset diff) const
diff方向にあるPiece を求める.
PatternLong(Direction d, Ptype s, LongTarget t)
Pattern(Direction d, Ptype s, Ptype t, bool ss, int attack, int defense)
bool match(const NumEffectState &state, Move move, const RatingEnv &) const
bool match(const NumEffectState &state, Square position, const RatingEnv &env) const
bool match(const NumEffectState &state, Move move, const RatingEnv &env) const
static bool isPromotable(Move move, Square position)
bool match(const NumEffectState &state, Move move, const RatingEnv &env) const
static Square nextSquare(Player player, Square start, Direction direction, Direction direction2)
Pattern(Direction d, Direction d2, Ptype s, Ptype t, bool ss, int attack, int defense)
bool match(const NumEffectState &state, Move move, PieceSquare p, const RatingEnv &env) const
const Square from() const
const Offset getOffset(Direction dir) const
bool matchOtherThanPromotable(const NumEffectState &state, Move move, PieceSquare p, const RatingEnv &env) const
std::pair< Piece, Square > PieceSquare
const std::string name() const
const Square nextSquare(Player P, Square pos, Direction dr) const
next position from pos for player P.
constexpr bool isPiece(Ptype ptype)
ptypeが空白やEDGEでないかのチェック
const Square square() const
static const Direction INVALID
PatternBlock(Ptype s, Ptype a, LongTarget t)
static Square nextSquare(Move move, Direction direction, Direction direction2)
LongTarget(Ptype t, bool p, bool s, int attack, int defense)
static const PieceSquare find(const NumEffectState &state, Move move, Ptype attacker_ptype)
bool match(const NumEffectState &, Move move, Piece p) const
bool match(const NumEffectState &state, Move move, const RatingEnv &env) const