3 #ifndef EFFECT_UTIL_NEIGHBORING8DIRECT_H 4 #define EFFECT_UTIL_NEIGHBORING8DIRECT_H 23 Entry() : has_unblockable_effect(false), nearest(
Offset::ZERO())
68 assert(! offset.
zero());
97 if (!nearest.isEdge() && state.
isEmptyBetween(from, nearest,
false))
112 return table.
hasEffect(state, ptypeo, from, target);
128 return table.
findNearest(state, ptypeo, from, target);
bool isEmptyBetween(Square from, Square to, Offset offset, bool pieceExistsAtTo=false) const
bool hasEffect(const NumEffectState &state, PtypeO ptypeo, Square from, Square target) const
constexpr Player alt(Player player)
Ptype getPtype(PtypeO ptypeO)
const Piece pieceAt(Square sq) const
bool hasEffectByPiece(Piece attack, Square target) const
駒attack が target に利きを持つか (旧hasEffectToと統合)
Offset32Base< 8, 9 > Offset32
bool has_unblockable_effect
CArray2d< Entry, PTYPEO_SIZE, Offset32::SIZE > table
Square kingSquare() const
const PtypeTable Ptype_Table
bool isOnBoard() const
盤面上を表すかどうかの判定. 1<=x() && x()<=9 && 1<=y() && y()<=9 Squareの内部表現に依存する. ...
Player getOwner(PtypeO ptypeO)
Square findNearest(const NumEffectState &state, PtypeO ptypeo, Square from, Square target) const
bool hasEffectOrAdditional(const NumEffectState &state, PtypeO ptypeo, Square from, Square target) const
Square kingMobilityOfPlayer(Player p, Direction d) const
玉がd方向にどこまで動けるかを返す
bool hasLongMove(Ptype ptype) const
遅くて良い?
static Square findNearest(const NumEffectState &state, PtypeO ptypeo, Square from, Square target)
unsigned int index() const
static bool hasEffect(const NumEffectState &state, PtypeO ptypeo, Square from, Square target)
ptypeo の駒がfromからtargetの8近傍に直接の利きを持つか
constexpr Direction longToShort(Direction d)
PtypeO
Player + Ptype [-15, 15] PtypeO の O は Owner の O.
static bool hasEffectFromTo(const NumEffectState &state, PtypeO ptypeo, Square from, Square target, Direction d)
static bool hasEffectNaive(const NumEffectState &state, PtypeO ptypeo, Square from, Square target)
const Offset getShortOffset(Offset32 offset32) const
Longの利きの可能性のあるoffsetの場合は, 反復に使う offsetを Shortの利きのoffsetの場合はそれ自身を返す...
static bool hasEffectOrAdditional(const NumEffectState &state, PtypeO ptypeo, Square from, Square target)
ptypeo の駒がfromからtargetの8近傍に直接の利きを持つか そのような駒への追加/影利きになっている ...
unsigned int ptypeOIndex(PtypeO ptypeo)
Direction getLongDirection(Offset32 offset32) const
static const Square STAND()
const BoardTable Board_Table