3 #ifndef OSL_PTYPETABLE_H 4 #define OSL_PTYPETABLE_H 43 return shortMoveMask[
playerToIndex(p)][
static_cast<int>(dir)] &
48 return numMaskLows[ptype];
60 return betterToPromote[ptype];
82 return csaNames[ptype];
86 return moveMasks[ptype];
91 return indexMins[ptype];
96 return indexLimits[ptype];
127 const int i2 = offset32.
index();
128 return effectTable[i1][i2];
138 return effectTableNotLongU[ptypeo-
PTYPEO_MIN][offset32.index()];
Ptype unpromote(Ptype ptype)
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す ...
bool hasUnblockableEffect() const
短い利きがある.長い利きの隣も含む
GeneralMask< mask_int_t > mask_t
int getMoveMask(Ptype ptype) const
CArray< int, PTYPE_SIZE > indexLimits
int y() const
将棋としてのY座標を返す.
CArray< int, PTYPE_SIZE > moveMasks
CArray< const char *, PTYPE_SIZE > csaNames
CArray2d< unsigned int, 2, SHORT_DIRECTION_SIZE > shortMoveMask
Offset32Base< 8, 9 > Offset32
bool isValidPtypeO(int ptypeO)
const char * getCsaName(Ptype ptype) const
bool hasUnblockableEffect(PtypeO attacker, Square from, Square to) const
const PtypeTable Ptype_Table
CArray< mask_t, PTYPE_SIZE > numMaskLows
bool isOnBoard() const
盤面上を表すかどうかの判定. 1<=x() && x()<=9 && 1<=y() && y()<=9 Squareの内部表現に依存する. ...
CArray2d< EffectContent, PTYPEO_SIZE, Offset32::SIZE > effectTableNotLongU
CArray2d< int, 2, PTYPE_SIZE > canDropLimit
bool hasLongMove(Ptype ptype) const
遅くて良い?
bool canDropTo(Player pl, Ptype ptype, Square pos) const
const EffectContent getEffect(PtypeO ptypeo, Square from, Square to) const
fromにいるptypeoがtoに利きを持つか?
CArray< bool, PTYPE_SIZE > betterToPromote
bool isValid(Player player)
cast等で作られたplayerが正しいかどうかを返す
bool isBasic(Ptype ptype)
ptypeが基本型(promoteしていない)かのチェック
constexpr int playerToIndex(Player player)
static int getKingIndex(Player p)
unsigned int index() const
mask_t getMaskLow(Ptype ptype) const
const EffectContent getEffectNotLongU(PtypeO ptypeo, Square from, Square to) const
ptypeo が,自分から offset のところに効きを持つか? U除く
CArray< const char *, PTYPE_SIZE > names
int getIndexLimit(Ptype ptype) const
CArray2d< EffectContent, PTYPEO_SIZE, Offset32::SIZE > effectTable
PtypeO
Player + Ptype [-15, 15] PtypeO の O は Owner の O.
EffectContent & effect(PtypeO ptypeo, Offset32 offset32)
int getIndex(Ptype) const
unsigned int getShortMoveMask(Player p, PtypeO ptypeo, Direction dir) const
bool isPromoted(Ptype ptype)
ptypeがpromote後の型かどうかのチェック
CArray< int, PTYPE_SIZE > numIndices
const EffectContent & getEffect(PtypeO ptypeo, Offset32 offset32) const
const char * getName(Ptype ptype) const
int getCanDropLimit(Player player, Ptype ptype) const
int getIndexMin(Ptype ptype) const
CArray< int, PTYPE_SIZE > indexMins
void initPtypeSub(Int2Type< false > isBasic)
bool isBetterToPromote(Ptype ptype) const