All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Member Functions | Static Public Member Functions | List of all members
osl::effect_util::EffectUtil Struct Reference

EffectState を活用するためのメソッド NumSimpleEffect などの公開インターフェースで 使って書けるコード More...

#include <effectUtil.h>

Classes

struct  FindThreat
 
struct  SafeCapture
 

Public Member Functions

template<osl::Player P, class Function , bool InterestEmpty>
void forEachEffectOfPtypeO (const NumEffectState &state, Square from, Ptype ptype, Function &f)
 
template<class Function , bool InterestEmpty>
void forEachEffectOfPtypeO (const NumEffectState &state, Square from, PtypeO ptypeo, Function &f)
 
template<osl::Player P>
osl::Piece safeCaptureNotByKing (const NumEffectState &state, Square target, Piece king)
 
template<class EvalT >
void findThreat (const NumEffectState &state, Square position, PtypeO ptypeo, PieceVector &out)
 

Static Public Member Functions

template<class Function , bool InterestEmpty>
static void forEachEffectOfPtypeO (const NumEffectState &state, Square, PtypeO, Function &f)
 PtypeO が Square にいると仮定した時にの利きを列挙. More...
 
template<Player P, class Function , bool InterestEmpty>
static void forEachEffectOfPtypeO (const NumEffectState &state, Square, Ptype, Function &f)
 
template<Player P>
static Piece safeCaptureNotByKing (const NumEffectState &state, Square target, Piece king)
 玉の素抜きなしに合法手でtargetに移動可能かを判定 More...
 
static Piece safeCaptureNotByKing (Player P, const NumEffectState &state, Square target)
 
template<class Action >
static void forEachEffect (Player P, const NumEffectState &state, Square pos, Action &a)
 forEachEffect の Player のtemplate 引数を通常の引数にしたバージョン More...
 
static void findEffect (Player P, const NumEffectState &state, Square target, container::PieceVector &out)
 target に利きのあるPieceをoutに格納する More...
 
template<class EvalT >
static void findThreat (const NumEffectState &state, Square position, PtypeO ptypeo, PieceVector &out)
 state の position に ptypeo があった場合を仮定して,脅威をoutに集める More...
 

Detailed Description

EffectState を活用するためのメソッド NumSimpleEffect などの公開インターフェースで 使って書けるコード

Definition at line 25 of file effectUtil.h.

Member Function Documentation

void osl::effect_util::EffectUtil::findEffect ( Player  P,
const NumEffectState &  state,
Square  target,
container::PieceVector out 
)
static

target に利きのあるPieceをoutに格納する

Definition at line 12 of file effectUtil.cc.

References forEachEffect(), and store().

template<class EvalT >
static void osl::effect_util::EffectUtil::findThreat ( const NumEffectState &  state,
Square  position,
PtypeO  ptypeo,
PieceVector &  out 
)
static

state の position に ptypeo があった場合を仮定して,脅威をoutに集める

template<class EvalT >
template void osl::EffectUtil::findThreat< PieceEval > ( const NumEffectState &  state,
Square  position,
PtypeO  ptypeo,
PieceVector &  out 
)

Definition at line 170 of file effectUtil.tcc.

References osl::alt(), and osl::getOwner().

template<class Action >
static void osl::effect_util::EffectUtil::forEachEffect ( Player  P,
const NumEffectState &  state,
Square  pos,
Action &  a 
)
inlinestatic

forEachEffect の Player のtemplate 引数を通常の引数にしたバージョン

Parameters
P探す対象の駒の所有者
posに利きのある駒を探す

Definition at line 63 of file effectUtil.h.

References osl::BLACK.

Referenced by findEffect().

template<class Function , bool InterestEmpty>
static void osl::effect_util::EffectUtil::forEachEffectOfPtypeO ( const NumEffectState &  state,
Square  ,
PtypeO  ,
Function &  f 
)
static

PtypeO が Square にいると仮定した時にの利きを列挙.

盤面が実際と違うと長い利きが不正確になる

Parameters
InterestEmpty空白のマスに興味があるか
template<Player P, class Function , bool InterestEmpty>
static void osl::effect_util::EffectUtil::forEachEffectOfPtypeO ( const NumEffectState &  state,
Square  ,
Ptype  ,
Function &  f 
)
static
template<osl::Player P, class Function , bool InterestEmpty>
void osl::effect_util::EffectUtil::forEachEffectOfPtypeO ( const NumEffectState &  state,
Square  from,
Ptype  ptype,
Function &  f 
)
template<class Function , bool InterestEmpty>
void osl::effect_util::EffectUtil::forEachEffectOfPtypeO ( const NumEffectState &  state,
Square  from,
PtypeO  ptypeo,
Function &  f 
)

Definition at line 89 of file effectUtil.tcc.

References osl::BLACK, osl::getOwner(), and osl::getPtype().

template<Player P>
static Piece osl::effect_util::EffectUtil::safeCaptureNotByKing ( const NumEffectState &  state,
Square  target,
Piece  king 
)
static

玉の素抜きなしに合法手でtargetに移動可能かを判定

Parameters
king玉 (玉で取る手は考えない)
Returns
移動可能な駒があれば,安全な駒を一つ.なければ Piece::EMPTY()
See Also
osl::move_classifier::PawnDropCheckmate
static Piece osl::effect_util::EffectUtil::safeCaptureNotByKing ( Player  P,
const NumEffectState &  state,
Square  target 
)
inlinestatic

Definition at line 48 of file effectUtil.h.

References osl::BLACK, and target.

template<osl::Player P>
osl::Piece osl::effect_util::EffectUtil::safeCaptureNotByKing ( const NumEffectState &  state,
Square  target,
Piece  king 
)

The documentation for this struct was generated from the following files: