All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Static Public Member Functions
osl::effect_util::EffectUtil Struct Reference

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

#include <effectUtil.h>

List of all members.

Classes

struct  FindThreat
struct  SafeCapture

Public Member Functions

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 にいると仮定した時にの利きを列挙.
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に移動可能かを判定
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 引数を通常の引数にしたバージョン
static void findEffect (Player P, const NumEffectState &state, Square target, container::PieceVector &out)
 target に利きのあるPieceをoutに格納する
template<class EvalT >
static void findThreat (const NumEffectState &state, Square position, PtypeO ptypeo, PieceVector &out)
 state の position に ptypeo があった場合を仮定して,脅威をoutに集める

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 
) [inline, static]

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>
void osl::effect_util::EffectUtil::forEachEffectOfPtypeO ( const NumEffectState &  state,
Square  from,
PtypeO  ptypeo,
Function &  f 
) [static]

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

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

Parameters:
InterestEmpty空白のマスに興味があるか

Definition at line 89 of file effectUtil.tcc.

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

template<osl::Player P, class Function , bool InterestEmpty>
void osl::effect_util::EffectUtil::forEachEffectOfPtypeO ( const NumEffectState &  state,
Square  from,
Ptype  ptype,
Function &  f 
) [static]

Definition at line 63 of file effectUtil.tcc.

References osl::PtypeTable::getMoveMask(), and osl::Ptype_Table.

template<osl::Player P>
osl::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

Definition at line 121 of file effectUtil.tcc.

References osl::Piece::isPiece(), osl::KING, osl::Piece::number(), osl::Piece::owner(), osl::Piece::ptype(), osl::effect_util::EffectUtil::SafeCapture::safe_one, and target.

static Piece osl::effect_util::EffectUtil::safeCaptureNotByKing ( Player  P,
const NumEffectState &  state,
Square  target 
) [inline, static]

Definition at line 48 of file effectUtil.h.

References osl::BLACK, and target.


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines