89 static const std::string
name(
int self,
int opponent);
99 return count(state, move.
to(), state.
turn()) ==
self 100 && count(state, move.
to(),
alt(state.
turn())) == opponent;
115 return diagonal*2+vertical;
133 return index(state, move) == property;
135 static const std::string
name(
int property);
149 :
Feature(
name(s,t,d,o)), self(s), target(t), drop(d), opponent_type(o) {}
155 if (! (move.
ptype() ==
self && last_move.
ptype() == target
156 && drop == move.
isDrop()))
158 switch (opponent_type) {
207 std::swap(rook1, rook2);
221 explicit BadLance(
bool h) :
Feature(h ?
"StrongBadLance" :
"WeakBadLance"), has_effect(h)
235 return basicMatch(state, move, front)
const Move lastMove(size_t last=1) const
bool match(const NumEffectState &state, Move move, const RatingEnv &env) const
static int index(const NumEffectState &state, Player player, Square from)
virtual bool match(const NumEffectState &state, Move, const RatingEnv &) const =0
bool hasEffectIf(PtypeO ptypeo, Square attacker, Square target) const
attackerにptypeoの駒がいると仮定した場合にtargetに利きがあるかどうか を stateをupdateしないで確かめる...
virtual bool effectiveInCheck() const
virtual bool effectiveInCheck() const
bool hasEffectAt(Square target) const
対象とするマスにあるプレイヤーの利きがあるかどうか.
constexpr Player alt(Player player)
bool match(const NumEffectState &, Move move, const RatingEnv &env) const
const Piece findAttackAt(Player attack, Square target) const
return a piece s.t.
bool effectiveInCheck() const
bool hasEffectByPtype(Player attack, Square target) const
target に ptype の利きがあるか? 成不成を区別しない
bool isNormal() const
INVALID でも PASS でもない.
int y() const
将棋としてのY座標を返す.
const Piece pieceOnBoard(Square sq) const
static const CArray< const char *, 4 > check_property
PtypeO ptypeO() const
移動後のPtype, i.e., 成る手だった場合成った後
int x() const
将棋としてのX座標を返す.
bool hasLastMove(size_t last=1) const
const Piece pieceOf(int num) const
bool match(const NumEffectState &state, Move move, const RatingEnv &) const
bool isMember(Square position) const
bool match(const NumEffectState &state, Move move, const RatingEnv &env) const
const Square from() const
static int index(const NumEffectState &state, Move move)
bool match(const NumEffectState &, Move move, const RatingEnv &env) const
bool hasPieceOnStand(Player player, Ptype ptype) const
static bool basicMatch(const NumEffectState &state, Move move, Square front)
Feature(const std::string &name)
OpponentType opponent_type
constexpr int sign(Player player)
bool effectiveInCheck() const
const Square square() const
Ptype capturePtype() const
bool isPawnMaskSet(Player player, int x) const
bool match(const NumEffectState &, Move move, const RatingEnv &env) const
Chase(Ptype s, Ptype t, bool d, OpponentType o)
const Square nextSquare(Player P, Square pos, Direction dr) const
next position from pos for player P.
bool match(const NumEffectState &state, Move move, const RatingEnv &) const
const std::string & name() const
bool match(const NumEffectState &state, Move move, const RatingEnv &) const
bool effectiveInCheck() const
bool isPieceStand() const
static int count(const NumEffectState &state, Square position, Player player)
bool match(const NumEffectState &, Move move, const RatingEnv &env) const
bool effectiveInCheck() const
static bool openLong(const NumEffectState &state, Move move)
const BoardTable Board_Table