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