3 #ifndef _BIGRAMATTACK_H 4 #define _BIGRAMATTACK_H 17 static const std::string
name(
int x1,
int y1,
int x2,
int y2,
int king_index,
bool s,
bool f);
18 BigramAttack(
int x1,
int y1,
int x2,
int y2,
int king_index,
bool s,
bool f)
19 :
Feature(
name(x1,y1,x2,y2,king_index,s,f)), property((((x1+2)*5+y1+2)*25 + (x2+2)*5+y2+2)*5 + king_index), same(s), focus_x(f)
25 int x = focus_x ? king.
x() : king.
y();
26 if (! focus_x && attack ==
WHITE)
36 int x_diff = move.
to().
x() - king.
x();
40 assert(x_diff >= 0 && x_diff <= 4);
41 int y_diff = move.
to().
y() - king.
y();
47 assert(y_diff >= 0 && y_diff <= 4);
48 return x_diff * 5 + y_diff;
68 int index = this->
index(state, move, env, same, focus_x);
const Move lastMove(size_t last=1) const
constexpr Player alt(Player player)
bool match(const NumEffectState &state, Move move, const RatingEnv &env) const
static int indexOfMove(Square king, Move move)
bool isNormal() const
INVALID でも PASS でもない.
int y() const
将棋としてのY座標を返す.
int x() const
将棋としてのX座標を返す.
bool hasLastMove(size_t last=1) const
Square kingSquare() const
static int index(const NumEffectState &state, Move move, const RatingEnv &env, bool same, bool focus_x)
const std::string & name() const
BigramAttack(int x1, int y1, int x2, int y2, int king_index, bool s, bool f)
static int indexKing(Player attack, Square king, bool focus_x)