3#ifndef OSL_MOVE_CLASSIFIER_PAWNDROPCHECKMATE_H
4#define OSL_MOVE_CLASSIFIER_PAWNDROPCHECKMATE_H
11 namespace move_classifier
37 const Piece king = state.template kingPiece<Opponent>();
53 return escape7(state, king_position, to);
59template <osl::Player P>
77 if (! state.template hasEffectAt<P>(target, attacker))
79 if (attacker == Piece::EMPTY())
81 assert(attacker.
owner() == P);
88 if (shortOffset.
zero())
95template <osl::Player P>
98 __attribute__ ((pure))
104 if (canEscape(state, king_position,
UL, to))
106 if (canEscape(state, king_position,
UR, to))
108 if (canEscape(state, king_position,
L, to))
110 if (canEscape(state, king_position,
R, to))
112 if (canEscape(state, king_position,
DL, to))
114 if (canEscape(state, king_position,
D, to))
116 if (canEscape(state, king_position,
DR, to))
const Offset getOffset(Direction dir) const
const Offset getShortOffsetNotKnight(Offset32 offset32) const
Longの利きの可能性のあるoffsetの場合は, 反復に使う offsetを Knight以外のShortの利きのoffsetの場合はそれ自身を返す.
bool hasEffectAt(Square target) const
対象とするマスにあるプレイヤーの利きがあるかどうか.
Piece safeCaptureNotByKing(Square target, Piece king) const
玉の素抜きなしに合法手でtargetに移動可能かを判定
uint64_t Iking8Info(Player king) const
const Square square() const
bool isOnBoardByOwner() const
piece がプレイヤーPの持ち物でかつボード上にある駒の場合は true.
static const Piece EMPTY()
const Piece pieceAt(Square sq) const
bool isPieceStand() const
bool isEdge() const
onBoardから8近傍のオフセットを足した点がedgeかどうかの判定 そこそこ速くなった.
unsigned int liberty() const
8-15 bit 目を 0-7bitにshiftして返す
long long v2di __attribute__((vector_size(16)))
const BoardTable Board_Table
constexpr Player alt(Player player)
static bool canEscape(const NumEffectState &state, Square kingSquare, Direction dir, Square dropAt)
kingSquare に居る alt(P)の玉が dir 方向に逃げられるか.
static bool escape7(const NumEffectState &state, Square kingSquare, Square to)
王が前以外に移動可能か
static bool isMember(const NumEffectState &state, Ptype ptype, Square from, Square to)