osl::move_generator::PieceOnBoard< Action, noCapturePromote > Struct Template Reference

特定のpieceを動かす手を生成 More...

`#include <pieceOnBoard.h>`

## Static Public Member Functions

template<Player P>
static void | generatePieceUnsafe (const NumEffectState &state, Piece p, Square target, Piece p1, Action &action)
| 駒pがマスtargetに利きをもっているとして，手を生成する．
template<Player P>
static void | generatePiece (const NumEffectState &state, Piece p, Square target, Piece p1, Action &action)
template<Player P, Ptype T>
static void | generatePiecePtypeUnsafe (const NumEffectState &state, Piece p, Square target, Piece p1, Action &action)
| PtypeがTの駒pがマスtargetに利きをもっているとして，手を生成する． p1 - targetにある駒
template<Player P, Ptype T>
static void | generatePiecePtype (const NumEffectState &state, Piece p, Square target, Piece p1, Action &action)
template<Player P, Ptype T, bool useDirMask>
static void | generatePtype (const NumEffectState &state, Piece p, Action &action, int dirMask=0)
| Generate moves without stating the Ptype as template param.
template<Player P, Ptype T>
static void | generatePtype (const NumEffectState &state, Piece p, Action &action)
template<Player P, Ptype T, bool useDirMask>
static void | generatePtypeUnsafe (const NumEffectState &state, Piece p, Action &action, int dirMask)
| Generate moves without stating the Ptype as template param.
template<Player P, Ptype T>
static void | generatePtypeUnsafe (const NumEffectState &state, Piece p, Action &action)
template<Player P, bool useDirMask>
static void | generate (const NumEffectState &state, Piece p, Action &action, int dirMask=0)
| Generate moves without stating the Ptype as template param.

## Detailed Description

template<class Action, bool noCapturePromote = false>
struct osl::move_generator::PieceOnBoard< Action, noCapturePromote >

特定のpieceを動かす手を生成

Definition at line 19 of file pieceOnBoard.h.

## Member Function Documentation

## generate()

template<class Action, bool noCapturePromote = false>
template<Player P, bool useDirMask>

template void osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generate< WHITE, true > | ( | const NumEffectState & | state,
|  | Piece | p,
|  | Action & | action,
|  | int | dirMask = 0 )

static

Generate moves without stating the Ptype as template param.

自玉に王手がかかっていない時に呼ぶ．

Parameters

  state | - 手を作成する局面，手番はPと一致
  p | - 盤面上に存在するPの駒
  action | - 手生成用のAction

Referenced by osl::move_generator::GeneratePieceOnBoard::generate().

## generatePiece()

template<class Action, bool noCapturePromote = false>
template<Player P>

void osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiece | ( | const NumEffectState & | state,
|  | Piece | p,
|  | Square | target,
|  | Piece | p1,
|  | Action & | action )

inline static

Definition at line 52 of file pieceOnBoard.h.

References osl::alt(), osl::Board_Table, generatePieceUnsafe(), osl::NumEffectState::hasEffectAt(), osl::KING, osl::Piece::number(), osl::NumEffectState::pinnedDir(), osl::NumEffectState::pinOrOpen(), osl::primDir(), osl::primDirUnsafe(), osl::Piece::ptype(), osl::Piece::square(), and osl::PieceMask::test().

## generatePiecePtype()

template<class Action, bool noCapturePromote = false>
template<Player P, Ptype T>

void osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtype | ( | const NumEffectState & | state,
|  | Piece | p,
|  | Square | target,
|  | Piece | p1,
|  | Action & | action )

inline static

Definition at line 92 of file pieceOnBoard.h.

References osl::alt(), osl::Board_Table, generatePiecePtypeUnsafe(), osl::NumEffectState::hasEffectAt(), osl::KING, osl::Piece::number(), osl::NumEffectState::pin(), osl::NumEffectState::pinnedDir(), osl::primDir(), osl::primDirUnsafe(), osl::Piece::square(), and osl::PieceMask::test().

## generatePiecePtypeUnsafe()

template<class Action, bool noCapturePromote = false>
template<Player P, Ptype T>

void osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtypeUnsafe | ( | const NumEffectState & | state,
|  | Piece | p,
|  | Square | target,
|  | Piece | p1,
|  | Action & | action )

inline static

PtypeがTの駒pがマスtargetに利きをもっているとして，手を生成する． p1 - targetにある駒

Definition at line 73 of file pieceOnBoard.h.

References osl::BISHOP, osl::BLACK, osl::canPromote(), osl::Square::canPromote(), osl::NumEffectState::hasEffectByPiece(), osl::KNIGHT, osl::LANCE, osl::PAWN, osl::promote(), osl::Piece::ptype(), osl::ROOK, osl::Piece::square(), and osl::Square::y().

Referenced by generatePiecePtype().

## generatePieceUnsafe()

template<class Action, bool noCapturePromote = false>
template<Player P>

void osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePieceUnsafe | ( | const NumEffectState & | state,
|  | Piece | p,
|  | Square | target,
|  | Piece | p1,
|  | Action & | action )

inline static

駒pがマスtargetに利きをもっているとして，手を生成する．

Definition at line 25 of file pieceOnBoard.h.

References osl::BLACK, osl::canPromote(), osl::Square::canPromote(), osl::NumEffectState::hasEffectByPiece(), osl::LANCE, osl::PAWN, osl::promote(), osl::Piece::ptype(), osl::Ptype_Table, osl::Piece::square(), and osl::Square::y().

Referenced by generatePiece().

## generatePtype() [1/2]

template<class Action, bool noCapturePromote = false>
template<Player P, Ptype T>

void osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePtype | ( | const NumEffectState & | state,
|  | Piece | p,
|  | Action & | action )

inline static

Definition at line 117 of file pieceOnBoard.h.

References generatePtype().

## generatePtype() [2/2]

template<class Action, bool noCapturePromote = false>
template<Player P, Ptype T, bool useDirMask>

void osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePtype | ( | const NumEffectState & | state,
|  | Piece | p,
|  | Action & | action,
|  | int | dirMask = 0 )

static

Generate moves without stating the Ptype as template param.

pinの場合はそれに応じた手を生成する

Parameters

  T | - moveTypeがTの駒
  state | - 手を作成する局面，手番はPと一致
  p | - 盤面上に存在するPの駒
  action | - 手生成用のAction

Referenced by generatePtype().

## generatePtypeUnsafe() [1/2]

template<class Action, bool noCapturePromote = false>
template<Player P, Ptype T>

void osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePtypeUnsafe | ( | const NumEffectState & | state,
|  | Piece | p,
|  | Action & | action )

inline static

Definition at line 133 of file pieceOnBoard.h.

References generatePtypeUnsafe().

## generatePtypeUnsafe() [2/2]

template<class Action, bool noCapturePromote = false>
template<Player P, Ptype T, bool useDirMask>

void osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePtypeUnsafe | ( | const NumEffectState & | state,
|  | Piece | p,
|  | Action & | action,
|  | int | dirMask )

static

Generate moves without stating the Ptype as template param.

pinでないことが判明している時に呼び出す

Parameters

  T | - moveTypeがTの駒
  state | - 手を作成する局面，手番はPと一致
  p | - 盤面上に存在するPの駒
  action | - 手生成用のAction

Referenced by generatePtypeUnsafe().

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

- pieceOnBoard.h
- pieceOnBoard.cc