Go to the documentation of this file.
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);
59 template <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())
95 template <osl::Player P>
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 Piece pieceAt(Square sq) const
unsigned int liberty() const
8-15 bit 目を 0-7bitにshiftして返す
const BoardTable Board_Table
Piece safeCaptureNotByKing(Square target, Piece king) const
玉の素抜きなしに合法手でtargetに移動可能かを判定
uint64_t Iking8Info(Player king) const
constexpr Player alt(Player player)
Offset32Base< 8, 9 > Offset32
static const Piece EMPTY()
static bool canEscape(const NumEffectState &state, Square kingSquare, Direction dir, Square dropAt)
kingSquare に居る alt(P)の玉が dir 方向に逃げられるか.
bool hasEffectAt(Square target) const
対象とするマスにあるプレイヤーの利きがあるかどうか.
bool isPieceStand() const
static bool isMember(const NumEffectState &state, Ptype ptype, Square from, Square to)
bool isOnBoardByOwner() const
piece がプレイヤーPの持ち物でかつボード上にある駒の場合は true.
const Offset getShortOffsetNotKnight(Offset32 offset32) const
Longの利きの可能性のあるoffsetの場合は, 反復に使う offsetを Knight以外のShortの利きのoffsetの場合はそれ自身を返す.
static bool escape7(const NumEffectState &state, Square kingSquare, Square to)
王が前以外に移動可能か
const Offset getOffset(Direction dir) const
bool isEdge() const
onBoardから8近傍のオフセットを足した点がedgeかどうかの判定 そこそこ速くなった.
long long v2di __attribute__((vector_size(16)))
const Square square() const