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