All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Functions
osl::move_generator::detail Namespace Reference

Functions

template<osl::Player P, class Action >
void generateMovePiecePtypeMask (const NumEffectState &state, Piece p, Square to, Piece toP, Action &action, unsigned int ptypeMask)
 マスtoに移動可能な駒pを移動する手を生成する. ptypeMaskで指定されたptypeになる場合以外は手を生成しない. More...
 
template<osl::Player P, class Action >
void generateMoveToPtypeMaskWithPieceMask (const NumEffectState &state, Square to, Piece toP, Action &action, unsigned int ptypeMask, PieceMask pieceMask)
 あるマスに利きを持つすべての駒の中で, ptypeMaskで指定されたptypeになる場合は移動する手を生成する More...
 
template<osl::Player P, class Action >
void generateMoveToPtypeMask (const NumEffectState &state, Square to, Piece toP, Action &action, unsigned int ptypeMask)
 
template<osl::Player P>
bool blockingU (const NumEffectState &state, Square pos)
 敵玉の前に歩を置いた場合に遮った利きで敵玉にlibertyが生まれるかどうか? More...
 
template<osl::Player P, int DirType, class Action >
void generateDir (const NumEffectState &state, Square target, Action &action, bool &hasPawnCheckmate, Offset dirOffset, Direction Dir, Direction primDir, int ptypeMaskNotKing)
 int DirType : 0 - U 1 - LRD 2 - UL,UR,DL,DR dirOffset = DirectionPlayerTraits<Dir,P>::offset() More...
 
template<osl::Player P, int DirType, class Action , Direction Dir>
void generateDir (const NumEffectState &state, Square target, Action &action, bool &hasPawnCheckmate)
 
template<osl::Player P, int DirType, class Action >
void generateDirNotKing (const NumEffectState &state, Square target, Action &action, CArray< unsigned char, 8 > &pieceMobility, int &spaces, PieceMask const &notPieceMask, Offset dirOffset, Direction Dir, Direction primDir, int ptypeMask, Direction dirByBlack)
 int DirType : 0 - U 1 - LRD 2 - UL,UR,DL,DR dirOffset = DirectionPlayerTraits<Dir,P>::offset() More...
 
template<osl::Player P, int DirType, class Action , Direction Dir>
void generateDirNotKing (const NumEffectState &state, Square target, Action &action, CArray< unsigned char, 8 > &pieceMobility, int &spaces, PieceMask const &notPieceMask)
 
template<osl::Player P, osl::Direction Dir, class Action , bool hasKnight>
void generateKnightDir (const NumEffectState &state, Square target, Action &action)
 
template<osl::Player P, class Action >
void generateKnightAll (const NumEffectState &state, Square target, Action &action)
 
template<osl::Player P, class Action >
void generateDrop (Square target, Action &action, int spaceMask, osl::Ptype T, int dirMask, Offset offset)
 
template<osl::Player P, class Action , Direction Dir>
void generateDropDir (Square target, Action &action, int spaceMask, osl::Ptype T)
 
template<Player P, class Action , bool mustCareSilver>
void generateOpenOrCapture (const NumEffectState &state, Square target, Piece p, int num, Action &action)
 
template<osl::Player P, class Action >
void generateRookLongMove (const NumEffectState &state, Square target, Action &action)
 
template<osl::Player P, class Action >
void generateRookLongMoveNotKing (const NumEffectState &state, Square target, Action &action, CArray< unsigned char, 8 > const &pieceMobility)
 
template<Player P, Ptype T, class Action >
void generateBishopLongMove (const NumEffectState &state, Square target, Action &action, Piece p, int num)
 
template<osl::Player P, Ptype T, class Action >
void generateBishopLongMoveNotKing (const NumEffectState &state, Square target, Action &action, CArray< unsigned char, 8 > const &pieceMobility, Piece p, int num)
 
template<Player P, class Action >
void generateDropGold (const NumEffectState &state, Square target, Action &action, int spaces)
 
template<Player P, class Action >
void generateDropSilver (const NumEffectState &state, Square target, Action &action, int spaces)
 
template<Player P, class Action , bool allEmpty>
void generateDropBishop (const NumEffectState &state, Square target, Action &action, Square ul, Square dr, Square ur, Square dl)
 allEmpty - shadow attackを生成する場合は,posがemptyでないこともある. More...
 
template<Player P, class Action , bool allEmpty>
void generateDropRook (const NumEffectState &state, Square target, Action &action, Square l, Square r, Square d, Square u)
 
template<osl::Player P, class Action >
void generateKing (const NumEffectState &state, Square target, Action &action, bool &hasPawnCheckmate)
 
template<osl::Player P, class Action >
void generateNotKing (const NumEffectState &state, Square target, Action &action)
 

Function Documentation

template<osl::Player P>
bool osl::move_generator::detail::blockingU ( const NumEffectState &  state,
Square  pos 
)

敵玉の前に歩を置いた場合に遮った利きで敵玉にlibertyが生まれるかどうか?

Definition at line 97 of file addEffectWithEffect.tcc.

References osl::BLACK, osl::Board_Table, osl::Piece::canMoveOn(), osl::BoardTable::getShortOffset(), osl::Square::square, and osl::Square::y().

template<Player P, Ptype T, class Action >
void osl::move_generator::detail::generateBishopLongMove ( const NumEffectState &  state,
Square  target,
Action &  action,
Piece  p,
int  num 
)
template<osl::Player P, Ptype T, class Action >
void osl::move_generator::detail::generateBishopLongMoveNotKing ( const NumEffectState &  state,
Square  target,
Action &  action,
CArray< unsigned char, 8 > const &  pieceMobility,
Piece  p,
int  num 
)
template<osl::Player P, int DirType, class Action >
void osl::move_generator::detail::generateDir ( const NumEffectState &  state,
Square  target,
Action &  action,
bool &  hasPawnCheckmate,
Offset  dirOffset,
Direction  Dir,
Direction  primDir,
int  ptypeMaskNotKing 
)

int DirType : 0 - U 1 - LRD 2 - UL,UR,DL,DR dirOffset = DirectionPlayerTraits<Dir,P>::offset()

Definition at line 125 of file addEffectWithEffect.tcc.

References osl::Piece::EMPTY(), osl::Piece::isEmpty(), osl::Square::isOnBoard(), osl::Piece::isOnBoardByOwner(), osl::LANCE, osl::PAWN, osl::primDir(), osl::Piece::square(), and osl::Square::x().

template<osl::Player P, int DirType, class Action , Direction Dir>
void osl::move_generator::detail::generateDir ( const NumEffectState &  state,
Square  target,
Action &  action,
bool &  hasPawnCheckmate 
)

Definition at line 191 of file addEffectWithEffect.tcc.

References target.

template<osl::Player P, int DirType, class Action >
void osl::move_generator::detail::generateDirNotKing ( const NumEffectState &  state,
Square  target,
Action &  action,
CArray< unsigned char, 8 > &  pieceMobility,
int &  spaces,
PieceMask const &  notPieceMask,
Offset  dirOffset,
Direction  Dir,
Direction  primDir,
int  ptypeMask,
Direction  dirByBlack 
)
template<osl::Player P, int DirType, class Action , Direction Dir>
void osl::move_generator::detail::generateDirNotKing ( const NumEffectState &  state,
Square  target,
Action &  action,
CArray< unsigned char, 8 > &  pieceMobility,
int &  spaces,
PieceMask const &  notPieceMask 
)

Definition at line 322 of file addEffectWithEffect.tcc.

References target.

template<osl::Player P, class Action >
void osl::move_generator::detail::generateDrop ( Square  target,
Action &  action,
int  spaceMask,
osl::Ptype  T,
int  dirMask,
Offset  offset 
)

Definition at line 361 of file addEffectWithEffect.tcc.

template<Player P, class Action , bool allEmpty>
void osl::move_generator::detail::generateDropBishop ( const NumEffectState &  state,
Square  target,
Action &  action,
Square  ul,
Square  dr,
Square  ur,
Square  dl 
)

allEmpty - shadow attackを生成する場合は,posがemptyでないこともある.

Definition at line 854 of file addEffectWithEffect.tcc.

References osl::BISHOP, and target.

template<osl::Player P, class Action , Direction Dir>
void osl::move_generator::detail::generateDropDir ( Square  target,
Action &  action,
int  spaceMask,
osl::Ptype  T 
)

Definition at line 369 of file addEffectWithEffect.tcc.

References target.

template<Player P, class Action >
void osl::move_generator::detail::generateDropGold ( const NumEffectState &  state,
Square  target,
Action &  action,
int  spaces 
)

Definition at line 825 of file addEffectWithEffect.tcc.

References osl::D, osl::GOLD, osl::L, osl::R, target, osl::U, osl::UL, and osl::UR.

template<Player P, class Action , bool allEmpty>
void osl::move_generator::detail::generateDropRook ( const NumEffectState &  state,
Square  target,
Action &  action,
Square  l,
Square  r,
Square  d,
Square  u 
)

Definition at line 875 of file addEffectWithEffect.tcc.

References osl::ROOK, and target.

template<Player P, class Action >
void osl::move_generator::detail::generateDropSilver ( const NumEffectState &  state,
Square  target,
Action &  action,
int  spaces 
)

Definition at line 838 of file addEffectWithEffect.tcc.

References osl::DL, osl::DR, osl::SILVER, target, osl::U, osl::UL, and osl::UR.

template<osl::Player P, class Action >
void osl::move_generator::detail::generateKing ( const NumEffectState &  state,
Square  target,
Action &  action,
bool &  hasPawnCheckmate 
)
template<osl::Player P, class Action >
void osl::move_generator::detail::generateKnightAll ( const NumEffectState &  state,
Square  target,
Action &  action 
)

Definition at line 349 of file addEffectWithEffect.tcc.

References osl::KNIGHT, and target.

template<osl::Player P, osl::Direction Dir, class Action , bool hasKnight>
void osl::move_generator::detail::generateKnightDir ( const NumEffectState &  state,
Square  target,
Action &  action 
)
template<osl::Player P, class Action >
void osl::move_generator::detail::generateMovePiecePtypeMask ( const NumEffectState &  state,
Piece  p,
Square  to,
Piece  toP,
Action &  action,
unsigned int  ptypeMask 
)

マスtoに移動可能な駒pを移動する手を生成する. ptypeMaskで指定されたptypeになる場合以外は手を生成しない.

Parameters
state- 盤面
p- 利きを持つコマ
to- 目的のマス
toP- 目的のマスに現在ある駒(又は空白)
action- 手生成のaction(典型的にはstoreかfilterつきstore)
ptypeMask- 移動後の駒のptypeに対応するbitが1なら手を生成する should promoteは? 呼び出す時はpinnedの場合のunsafeなdirectionは排除済み

Definition at line 31 of file addEffectWithEffect.tcc.

References osl::canPromote(), osl::Square::canPromote(), osl::Piece::isOnBoardByOwner(), osl::promote(), osl::Piece::ptype(), and osl::Piece::square().

template<osl::Player P, class Action >
void osl::move_generator::detail::generateMoveToPtypeMask ( const NumEffectState &  state,
Square  to,
Piece  toP,
Action &  action,
unsigned int  ptypeMask 
)

Definition at line 80 of file addEffectWithEffect.tcc.

template<osl::Player P, class Action >
void osl::move_generator::detail::generateMoveToPtypeMaskWithPieceMask ( const NumEffectState &  state,
Square  to,
Piece  toP,
Action &  action,
unsigned int  ptypeMask,
PieceMask  pieceMask 
)

あるマスに利きを持つすべての駒の中で, ptypeMaskで指定されたptypeになる場合は移動する手を生成する

Parameters
state- 盤面
to- 目的のマス
toP- 目的のマスに現在ある駒(又は空白)
action- 手生成のaction(典型的にはstoreかfilterつきstore)
ptypeMask- 移動後の駒のptypeに対応するbitが1なら手を生成する pinnedの場合は移動する手が1手もない場合もある.

Definition at line 59 of file addEffectWithEffect.tcc.

References osl::Board_Table, osl::KING, osl::primDir(), osl::primDirUnsafe(), and osl::Piece::square().

template<osl::Player P, class Action >
void osl::move_generator::detail::generateNotKing ( const NumEffectState &  state,
Square  target,
Action &  action 
)
template<Player P, class Action , bool mustCareSilver>
void osl::move_generator::detail::generateOpenOrCapture ( const NumEffectState &  state,
Square  target,
Piece  p,
int  num,
Action &  action 
)
template<osl::Player P, class Action >
void osl::move_generator::detail::generateRookLongMove ( const NumEffectState &  state,
Square  target,
Action &  action 
)
template<osl::Player P, class Action >
void osl::move_generator::detail::generateRookLongMoveNotKing ( const NumEffectState &  state,
Square  target,
Action &  action,
CArray< unsigned char, 8 > const &  pieceMobility 
)