18 static const std::string
name(
Ptype self,
Ptype target,
bool same);
22 self(s), target(t), same(ss)
27 if (move.
ptype() !=
self)
52 static const std::string
name(
Ptype self,
bool drop,
int danger);
62 for (
int dx=-1; dx<=1; ++dx) {
63 for (
int dy=-1; dy<=1; ++dy) {
64 if (dx == 0 && dy ==0)
72 if (king.x() == 1 || king.x() == 9)
88 return attack.isPiece() && attack.ptype() ==
LANCE 99 return blocking(state, king, move.
to());
112 return blocking(state, king, move.
to());
116 if (move.
ptype() !=
self)
118 if (
count(state) != danger)
121 return matchDrop(state, move);
122 return matchMove(state, move);
bool hasEffectAt(Square target) const
対象とするマスにあるプレイヤーの利きがあるかどうか.
constexpr Player alt(Player player)
const Piece findAttackAt(Player attack, Square target) const
return a piece s.t.
int min(Player p, int v1, int v2)
static int count(const NumEffectState &state)
const Piece pieceAt(Square sq) const
const Piece pieceOnBoard(Square sq) const
bool hasEffectByPiece(Piece attack, Square target) const
駒attack が target に利きを持つか (旧hasEffectToと統合)
PtypeO ptypeO() const
移動後のPtype, i.e., 成る手だった場合成った後
PtypeO newPtypeO(Player player, Ptype ptype)
static bool matchMove(const NumEffectState &state, Move move)
bool match(const NumEffectState &state, Move move, const RatingEnv &) const
Square kingSquare() const
bool match(const NumEffectState &state, Move move, const RatingEnv &env) const
const Square from() const
bool isNeighboring8(Square to) const
static Square findNearest(const NumEffectState &state, PtypeO ptypeo, Square from, Square target)
static bool hasEffect(const NumEffectState &state, PtypeO ptypeo, Square from, Square target)
ptypeo の駒がfromからtargetの8近傍に直接の利きを持つか
static bool matchDrop(const NumEffectState &state, Move move)
DefenseKing8(Ptype s, bool d, int dan)
constexpr bool isPiece(Ptype ptype)
ptypeが空白やEDGEでないかのチェック
static bool blocking(const NumEffectState &state, Square king, Square to)
const std::string & name() const
AttackKing8(Ptype s, Ptype t, bool ss, int attack, int defense)
bool isPieceStand() const
bool match(const NumEffectState &state, Square position, const RatingEnv &env) const
static std::pair< int, int > count(const NumEffectState &state, Square position, const RatingEnv &env)