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