osl::move_generator::addeffect8 Namespace Reference

- Main Page
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

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

## Classes
class | ShortPieceAction
| promote可能な足の短い駒による利きの生成用 Functor More...
class | GoldAction
| Goldによる利きの生成用 Functor. More...
class | LongPieceAction
| promote可能な足の長い駒による利きの生成用 Functor More...
class | AddEffect8Table

## Typedefs
typedef std::pair< Offset, Offset > | OffsetPair
| 利きをつける手を生成するためのテーブル． More...
typedef std::pair< Square, Offset > | PO
typedef std::pair< Square, OffsetPair > | POO

## Functions
template<Player P, Ptype T, class Action >
void | generateShortDrop (NumEffectState const &state, Square target, Action &action)
| 5x5領域への駒のdropによる手生成. More...
template<Player P, Ptype T, class Action >
void | generateLongDropWithOffset (NumEffectState const &state, Square to, Square from, Offset offset, int countMax, Action &action)
| 方向を決めて，long dropを作成する． More...
template<Player P, Ptype T, class Action >
void | generateLongDrop (NumEffectState const &state, Square target, Action &action)
| 長い利きを持つ駒のdropによる手生成. More...
template<Player P, Ptype T, class Action >
void | generateShortMove (NumEffectState const &state, Piece attacker, Square target, Action &action)
| unblockableな動きでunblockableな利きをつける手生成. More...
template<Player P>
bool | findBlocker (NumEffectState const &state, Piece attacker, Square target, Square from, Square &pos, Piece &blocker, Offset offset)
| fromにプレイヤーPの駒がある． toは玉の8近傍でPがfromから長い利きを持ちうるマスだとする． 味方の駒で8近傍への利きをblockしている駒(味方か敵かを問わず)があるかどうかをチェックし， あるならblockerに入れてtrueを返す More...
template<Player P, Ptype T>
bool | canAddLongEffect (NumEffectState const &state, Square from, Square to, Piece &blocker, Offset offset)
| fromにプレイヤーPの種類Tの駒があったら利きがある盤面かどうか. More...
template<Player P, Ptype T>
bool | canAddLongEffect (NumEffectState const &state, Square from, Square to, Piece &blocker)
| fromにプレイヤーPの種類Tの駒があったら利きがある盤面かどうか. More...
template<Player P, Ptype T, class Action >
void | generateLongMove (NumEffectState const &state, Piece attacker, Square target, Action &action)
| 長い利きも持つ駒の手生成. More...
template<Player P, Ptype T, class Action >
void | generateShort (const NumEffectState &state, Square target, Action &action)
template<Player P, Ptype T, class Action >
void | generateLong (const NumEffectState &state, Square target, Action &action)
template<Player P, class Action >
void | generateGold (const NumEffectState &state, Square target, Action &action)
bool | sameDirection (int dx0, int dy0, int dx1, int dy1)
bool | hasUnblockableEffect (Ptype ptype, int dx, int dy)
| targetから(+dx,+dy)の位置にある黒の種類ptypeの駒がdirectな利きを持つか. More...
bool | hasShortEffect (Ptype ptype, int dx, int dy)
bool | hasEffect (Ptype ptype, int dx, int dy)

## Typedef Documentation

typedef std::pair<Offset,Offset> osl::move_generator::addeffect8::OffsetPair

利きをつける手を生成するためのテーブル．

Definition at line 22 of file addEffect8Table.h.

typedef std::pair<Square,Offset> osl::move_generator::addeffect8::PO

Definition at line 23 of file addEffect8Table.h.

typedef std::pair<Square,OffsetPair> osl::move_generator::addeffect8::POO

Definition at line 24 of file addEffect8Table.h.

## Function Documentation

template<Player P, Ptype T>

bool osl::move_generator::addeffect8::canAddLongEffect | ( | NumEffectState const & | state,
|  | Square | from,
|  | Square | to,
|  | Piece & | blocker,
|  | Offset | offset
| ) |  |

fromにプレイヤーPの種類Tの駒があったら利きがある盤面かどうか.

追加も含める. 間が全部空白なら利きがあるのが前提．

Parameters

  P(template) | - 利きをつけるプレイヤー
  T | - 駒の種類(ROOK, BISHOP, LANCEのいずれか)
  state | - 盤面の状態
  from | - 駒があると仮定するマス
  to | - 利きの有無を判定したいマス
  blocker | - 利きがない時にブロックしている駒を返す
  offset | - toからfromへのoffset(redundant)

Definition at line 242 of file addEffect8.tcc.

References osl::PtypeTable::getEffect(), hasEffect(), osl::Piece::isEdge(), osl::Piece::isEmpty(), osl::Piece::isOnBoardByOwner(), osl::Ptype_Table, and osl::Piece::ptypeO().

template<Player P, Ptype T>

bool osl::move_generator::addeffect8::canAddLongEffect | ( | NumEffectState const & | state,
|  | Square | from,
|  | Square | to,
|  | Piece & | blocker
| ) |  |

fromにプレイヤーPの種類Tの駒があったら利きがある盤面かどうか.

追加も含める. 間が全部空白なら利きがあるのが前提．

Parameters

  P(template) | - 利きをつけるプレイヤー
  T | - 駒の種類(ROOK, BISHOP, LANCEのいずれか)
  state | - 盤面の状態
  from | - 駒があると仮定するマス
  to | - 利きの有無を判定したいマス
  blocker | - 利きがない時にブロックしている駒を返す

Definition at line 269 of file addEffect8.tcc.

References osl::Board_Table, and osl::BoardTable::getShortOffset().

template<Player P>

bool osl::move_generator::addeffect8::findBlocker | ( | NumEffectState const & | state,
|  | Piece | attacker,
|  | Square | target,
|  | Square | from,
|  | Square & | pos,
|  | Piece & | blocker,
|  | Offset | offset
| ) |  |

fromにプレイヤーPの駒がある． toは玉の8近傍でPがfromから長い利きを持ちうるマスだとする． 味方の駒で8近傍への利きをblockしている駒(味方か敵かを問わず)があるかどうかをチェックし， あるならblockerに入れてtrueを返す

Definition at line 187 of file addEffect8.tcc.

References osl::PtypeTable::getEffect(), hasEffect(), osl::Piece::isEmpty(), osl::Piece::isOnBoardByOwner(), osl::Ptype_Table, osl::Piece::ptypeO(), osl::Piece::square(), osl::Square::x(), and osl::Square::y().

template<Player P, class Action >

void osl::move_generator::addeffect8::generateGold | ( | const NumEffectState & | state,
|  | Square | target,
|  | Action & | action
| ) |  |

drop move

Definition at line 453 of file addEffect8.tcc.

References target.

Referenced by osl::move_generator::AddEffect< P, isAttackToKing >::generate().

template<Player P, Ptype T, class Action >

void osl::move_generator::addeffect8::generateLong | ( | const NumEffectState & | state,
|  | Square | target,
|  | Action & | action
| ) |  |

Definition at line 442 of file addEffect8.tcc.

References osl::BOOST_STATIC_ASSERT().

template<Player P, Ptype T, class Action >

void osl::move_generator::addeffect8::generateLongDrop | ( | NumEffectState const & | state,
|  | Square | target,
|  | Action & | action
| ) |  |

長い利きを持つ駒のdropによる手生成.

追加利きも生成する.

Parameters

  P(template) | - 手番のプレイヤー
  T(template) | - 置こうとする駒の種類(当然basic)
  state | - 盤面
  target | - 相手の玉のposition(redundantだが)
  action | - 手生成のcallback

Definition at line 83 of file addEffect8.tcc.

References osl::move_generator::Add_Effect8_Table, osl::BISHOP, osl::Offset::blackOffset(), osl::BOOST_STATIC_ASSERT(), osl::move_generator::addeffect8::AddEffect8Table::getLongDrop2Square(), osl::move_generator::addeffect8::AddEffect8Table::getLongDropDirect(), osl::move_generator::addeffect8::AddEffect8Table::getLongDropSquare(), osl::Piece::isOnBoardByOwner(), osl::LANCE, osl::ROOK, osl::Square::squareForBlack(), target, and osl::Offset::zero().

template<Player P, Ptype T, class Action >

void osl::move_generator::addeffect8::generateLongDropWithOffset | ( | NumEffectState const & | state,
|  | Square | to,
|  | Square | from,
|  | Offset | offset,
|  | int | countMax,
|  | Action & | action
| ) |  |

方向を決めて，long dropを作成する．

Parameters

  P(template) | - 手番のプレイヤー
  T(template) | - 置こうとする駒の種類(当然basic)
  state | - 盤面
  to | - 利きを追加する点
  from | - 置き始める点
  offset | - 次に置く点へのoffset
  action | - 手生成のcallback

Definition at line 54 of file addEffect8.tcc.

References count, osl::PtypeTable::getEffect(), hasEffect(), osl::Piece::isOnBoardByOwner(), osl::LANCE, osl::Ptype_Table, and osl::Piece::ptypeO().

template<Player P, Ptype T, class Action >

void osl::move_generator::addeffect8::generateLongMove | ( | NumEffectState const & | state,
|  | Piece | attacker,
|  | Square | target,
|  | Action & | action
| ) |  |

長い利きも持つ駒の手生成.

Parameters

  P(template) | - 攻撃側のプレイヤー
  T(template) | - 攻撃側の駒の種類
  isPromotion(template) | - 成っての攻撃(成れるかは内部でチェック)
  state | - 局面
  attacker | - 攻撃しようとする駒
  from | - 攻撃しようとする駒の位置
  target | - 攻撃しようとするマス

Definition at line 285 of file addEffect8.tcc.

References osl::move_generator::Add_Effect8_Table, osl::BISHOP, osl::BLACK, osl::Offset::blackOffset(), osl::Board_Table, osl::canPromote(), osl::Square::canPromote(), osl::Piece::EMPTY(), osl::move_generator::addeffect8::AddEffect8Table::getBetweenOffset(), osl::BoardTable::getLongDirection(), osl::move_generator::addeffect8::AddEffect8Table::getLongMoveOffset(), osl::move_generator::addeffect8::AddEffect8Table::getShortMoveOffset(), osl::Square::isOnBoard(), osl::LANCE, osl::longToShort(), osl::Piece::number(), osl::primDir(), osl::ROOK, osl::Piece::square(), and osl::Offset::zero().

template<Player P, Ptype T, class Action >

void osl::move_generator::addeffect8::generateShort | ( | const NumEffectState & | state,
|  | Square | target,
|  | Action & | action
| ) |  |

drop move

Definition at line 427 of file addEffect8.tcc.

References osl::BOOST_STATIC_ASSERT(), and target.

template<Player P, Ptype T, class Action >

void osl::move_generator::addeffect8::generateShortDrop | ( | NumEffectState const & | state,
|  | Square | target,
|  | Action & | action
| ) |  |

5x5領域への駒のdropによる手生成.

BISHOPやROOKは敵の利きのない場合のみ生成 -> pinned以外の利きに変更(2009/12/24)

Parameters

  P(template) | - 手番のプレイヤー
  T(template) | - 置こうとする駒の種類(当然basic)
  state | - 盤面
  target | - 相手の玉のposition(redundantだが)
  action | - 手生成のcallback

Definition at line 27 of file addEffect8.tcc.

References osl::move_generator::Add_Effect8_Table, osl::alt(), osl::BISHOP, osl::move_generator::addeffect8::AddEffect8Table::getDropSquare(), osl::Square::isPieceStand(), osl::PAWN, osl::ROOK, osl::Square::squareForBlack(), and osl::Square::x().

template<Player P, Ptype T, class Action >

void osl::move_generator::addeffect8::generateShortMove | ( | NumEffectState const & | state,
|  | Piece | attacker,
|  | Square | target,
|  | Action & | action
| ) |  |

unblockableな動きでunblockableな利きをつける手生成.

Parameters

  P(template) | - 攻撃側のプレイヤー
  T(template) | - 攻撃側の駒の種類
  state | - 局面
  from | - 攻撃しようとする駒の位置
  target | - 攻撃しようとするマス

Definition at line 156 of file addEffect8.tcc.

References osl::move_generator::Add_Effect8_Table, osl::Offset::blackOffset(), osl::PtypePlayerTraits< T, P >::canDropTo(), osl::Square::canPromote(), osl::move_generator::addeffect8::AddEffect8Table::getShortMoveOffset(), osl::Square::isEdge(), osl::Piece::isEmpty(), osl::Square::isOnBoard(), osl::KNIGHT, osl::Piece::number(), osl::PAWN, osl::Piece::square(), and osl::Offset::zero().

bool osl::move_generator::addeffect8::hasEffect | ( | Ptype | ptype,
|  | int | dx,
|  | int | dy
| ) |  |

Definition at line 46 of file addEffect8Table.cc.

References osl::BLACK, osl::PtypeTable::getEffect(), osl::EffectContent::hasEffect(), osl::newPtypeO(), and osl::Ptype_Table.

Referenced by osl::search::QuiescenceGenerator< P >::attackSilverWithPawn(), osl::rating::DefenseKing8::blocking(), canAddLongEffect(), osl::move_probability::Feature::classifyEffect9(), osl::rating::CountEffect2::count(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::search::QuiescenceGenerator< P >::escapeByMoveOnly(), osl::eval::ml::Promotion37::evalOne(), findBlocker(), osl::move_probability::StateInfo::findShortThreatmate(), osl::checkmate::Dfpn::generateCheck(), generateLongDropWithOffset(), osl::importantMove(), osl::PtypeTable::init(), osl::move_generator::addeffect8::AddEffect8Table::initLongDropSquare(), osl::move_generator::addeffect8::AddEffect8Table::initMoveOffset(), osl::move_probability::BreakThreatmate::isDefendingKing8(), osl::move_classifier::AttackDefenceAroundKing< P >::isMember(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::move_probability::BreakThreatmate::match(), osl::move_probability::CheckmateIfCapture::match(), osl::move_probability::SacrificeAttack::match(), osl::move_probability::KingBlockade::match(), osl::move_probability::EscapeThreatened::match(), osl::rating::DefenseKing8::matchDrop(), osl::rating::Karanari::matchGeneral(), osl::rating::DefenseKing8::matchMove(), osl::threatmate::KfendPredictor::predict(), osl::threatmate::TreePredictor::predict(), osl::threatmate::MlPredictor::predict(), osl::threatmate::TreePredictor::probability(), osl::progress::ml::NewProgress::promotion37One(), osl::ntesuki::NtesukiMoveGenerator::setOrder(), osl::annotate::ThreatmateIfMorePieces::suitable(), and osl::search::SearchState2Core::tryThreatmate().

bool osl::move_generator::addeffect8::hasShortEffect | ( | Ptype | ptype,
|  | int | dx,
|  | int | dy
| ) |  |

Definition at line 35 of file addEffect8Table.cc.

References osl::BLACK, osl::PtypeTable::getEffect(), osl::EffectContent::hasEffect(), osl::newPtypeO(), osl::EffectContent::offset(), osl::Ptype_Table, and osl::Offset::zero().

bool osl::move_generator::addeffect8::hasUnblockableEffect | ( | Ptype | ptype,
|  | int | dx,
|  | int | dy
| ) |  |

targetから(+dx,+dy)の位置にある黒の種類ptypeの駒がdirectな利きを持つか.

Definition at line 24 of file addEffect8Table.cc.

References osl::BLACK, osl::PtypeTable::getEffect(), osl::EffectContent::hasUnblockableEffect(), osl::newPtypeO(), and osl::Ptype_Table.

Referenced by osl::move_generator::addeffect8::AddEffect8Table::initDropSquare(), osl::move_generator::addeffect8::AddEffect8Table::initLongDropSquare(), and osl::move_generator::addeffect8::AddEffect8Table::initMoveOffset().

bool osl::move_generator::addeffect8::sameDirection | ( | int | dx0,
|  | int | dy0,
|  | int | dx1,
|  | int | dy1
| ) |  |

Definition at line 13 of file addEffect8Table.cc.

Referenced by osl::move_generator::addeffect8::AddEffect8Table::initMoveOffset().