28 if (move.
ptype() !=
self)
31 = Neighboring8Direct::findNearest(state, move.
ptypeO(), move.
to(), state.kingSquare(
alt(state.turn())));
34 if (! move.
isDrop() && state.hasEffectByPiece(state.pieceOnBoard(move.
from()), position))
36 const Piece p = state.pieceAt(position);
58 static int count(
const NumEffectState& state)
61 const Square king = state.kingSquare(
alt(attack));
63 for (
int dx=-1; dx<=1; ++dx) {
64 for (
int dy=-1; dy<=1; ++dy) {
65 if (dx == 0 && dy ==0)
68 if (! state.pieceAt(p).isEdge()
69 && state.hasEffectAt(attack, p))
73 if (king.x() == 1 || king.x() == 9)
79 const Player attacker =
alt(state.turn());
80 Piece attack = state.findAttackAt<
BISHOP>(attacker, to);
84 attack = state.findAttackAt<
ROOK>(attacker, to);
88 attack = state.findAttackAt<
LANCE>(attacker, to);
89 return attack.isPiece() && attack.ptype() ==
LANCE
96 const Square king = state.kingSquare(state.turn());
108 const Square king = state.kingSquare(state.turn());
117 if (move.
ptype() !=
self)