29 const int y = king.
y() +
sign(state.
turn())*4;
30 if (y != move.
to().
y())
32 const int x = move.
to().
x();
33 return (x == king.
x() || abs(king.
x() - x) == 2);
45 for (
int i=0; i<2; ++i) {
46 const Square kp = knight_position[i];
98 if (! isCandidate(cstate, move))
101 Helper helper = { &result, &state };
104 if (result && ! isCandidate(cstate, move))
105 std::cerr << cstate << move <<
"\n", assert(0);
const Square nextSquare(Player P, Square pos, Direction dr) const
next position from pos for player P.
PtypeO ptypeO() const
移動後のPtype, i.e., 成る手だった場合成った後
Ptype capturePtype() const
PtypeO capturePtypeO() const
const Square from() const
const checkmate::King8Info king8Info(Player king) const
bool hasEffectNotBy(Player player, Piece piece, Square target) const
対象とするマスにあるプレイヤーの(ただしある駒以外)利きがあるかどうか.
bool hasEffectIf(PtypeO ptypeo, Square attacker, Square target) const
attackerにptypeoの駒がいると仮定した場合にtargetに利きがあるかどうか を stateをupdateしないで確かめる.
bool inCheck(Player P) const
Pの玉が王手状態
const mask_t longEffectAt(Square target) const
void makeUnmakeMove(Move move, Function &f)
bool hasEffectByPtypeStrict(Player attack, Square target) const
target に ptype の利きがあるか? 成不成を区別
bool canMoveOn() const
Player Pの駒が,thisの上に移動できるか? PIECE_EMPTY 0x00008000 BLACK_PIECE 0x000XxxYY X>=2, YY>0 PIECE_EDGE 0xfff1...
const Piece pieceOnBoard(Square sq) const
bool hasPieceOnStand(Player player, Ptype ptype) const
Square kingSquare() const
const Piece pieceAt(Square sq) const
int y() const
将棋としてのY座標を返す.
bool isNeighboring8(Square to) const
int x() const
将棋としてのX座標を返す.
unsigned int liberty() const
8-15 bit 目を 0-7bitにshiftして返す
unsigned int moveCandidate2() const
24-31 bit 目を 0-7bitにshiftして返す
unsigned int dropCandidate() const
0-7 bit 目を返す
static bool hasEffectOrAdditional(const NumEffectState &state, PtypeO ptypeo, Square from, Square target)
ptypeo の駒がfromからtargetの8近傍に直接の利きを持つか そのような駒への追加/影利きになっている
bool match(const NumEffectState &state, Move move, const RatingEnv &) const
static bool isCandidate(const NumEffectState &state, Move move)
static bool knight2Step(const NumEffectState &state, Move move, Square king)
static bool captureForKnightCheck(const NumEffectState &state, Move move, Square king)
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す
const BoardTable Board_Table
constexpr int sign(Player player)
constexpr Player alt(Player player)
PtypeO newPtypeO(Player player, Ptype ptype)
PtypeO captured(PtypeO ptypeO)
unpromoteすると共に,ownerを反転する.