osl::state::NumEffectState Class Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
osl::state::NumEffectState Class Reference

利きを持つ局面 More...

`#include <numEffectState.h>`

Inheritance diagram for osl::state::NumEffectState:
[legend]
Collaboration diagram for osl::state::NumEffectState:
[legend]

## Public Member Functions
| NumEffectState (const state::SimpleState &st=SimpleState(HIRATE))
| ~NumEffectState ()
void | copyFrom (const NumEffectState &src)
| 主要部分を高速にコピーする. More...
void | copyFrom (const SimpleState &src)
bool | isConsistent (bool showError=true) const
bool | isConsistent (const NumEffectState &prev, Move moved, bool show_error=true) const
| 局面更新に関する一貫性をテスト More...
void | showEffect (std::ostream &os) const
const PieceMask & | piecesOnBoard (Player p) const
const PieceMask | promotedPieces () const
const PieceMask | pin (Player king) const
const PieceMask | checkShadow (Player attack) const
| attack の駒で動くと開き王手になる可能性がある集合 More...
PieceMask | pinOrOpen (Player king) const
uint64_t | Iking8Info (Player king) const
const checkmate::King8Info | king8Info (Player king) const
bool | inCheck (Player P) const
| Pの玉が王手状態 More...
bool | inCheck () const
| 手番の玉が王手状態 More...
const EffectedNumTable & | longEffectNumTable () const
const PieceMask | effectedMask (Player pl) const
| pl からの利きが(1つ以上)ある駒一覧 More...
const PieceMask | effectedChanged (Player pl) const
| 前の指手でeffectedMask(pl)が変化したか. More...
bool | hasChangedEffects () const
const BoardMask | changedEffects (Player pl) const
const BoardMask | changedEffects () const
const NumBitmapEffect | changedPieces () const
template<Ptype PTYPE>
bool | longEffectChanged () const
template<Ptype PTYPE>
bool | anyEffectChanged () const
const Piece | findThreatenedPiece (Player P) const
| 取られそうなPの駒で価値が最大のもの More...
bool | isOnBoardNum (int num) const
Square | mobilityOf (Direction d, int num) const
Square | mobilityOf (Direction d, Piece p) const
Square | kingMobilityAbs (Player p, Direction d) const
Square | kingMobilityOfPlayer (Player p, Direction d) const
| 玉がd方向にどこまで動けるかを返す More...
template<Player P>
Direction | pinnedDir (Piece p) const
| pinされた駒がPのKingから見てどの方向か? Pから見たdirectionを返す More...
Direction | pinnedDir (Piece p) const
template<Player P>
bool | pinnedCanMoveTo (Piece p, Square to) const
| pinされた駒pがtoに動けるか? pinに関係がなければtoへ動けるという前提 More...
bool | pinnedCanMoveTo (Piece p, Square to) const
template<Player P>
Piece | pinAttacker (Piece pinned) const
| Pのpinされた駒から，そのpinの原因となっている長い利きを持つ駒を得る． More...
Piece | pinAttacker (Piece pinned) const
const NumBitmapEffect | effectSetAt (Square sq) const
int | countEffect (Player player, Square target) const
| 利きの数を数える. More...
int | countEffect (Player player, Square target, PieceMask pins) const
| 利きの数を数える. More...
template<Ptype PTYPE>
const mask_t | allEffectAt (Player P, Square target) const
const mask_t | allEffectAt (Player P, Ptype ptype, Square target) const
template<Ptype PTYPE>
const mask_t | longEffectAt (Square target) const
template<Ptype PTYPE>
const mask_t | longEffectAt (Square target, Player owner) const
const mask_t | longEffectAt (Square target) const
const mask_t | longEffectAt (Square target, Player owner) const
template<Player P>
bool | hasEffectAt (Square target) const
| 対象とするマスにあるプレイヤーの利きがあるかどうか. More...
bool | hasEffectAt (Player player, Square target) const
| 対象とするマスにあるプレイヤーの利きがあるかどうか. More...
template<Ptype PTYPE>
bool | hasLongEffectAt (Player P, Square to) const
| あるマスにPTYPEの長い利きがあるかどうか. More...
template<Ptype PTYPE>
bool | hasEffectByPtype (Player attack, Square target) const
| target に ptype の利きがあるか? 成不成を区別しない More...
template<Ptype PTYPE>
bool | hasEffectByPtypeStrict (Player attack, Square target) const
| target に ptype の利きがあるか? 成不成を区別 More...
template<Direction Dir, Player P>
bool | hasEffectInDirection (Square to) const
| あるマスにあるDirectionでの長い利きがあるかどうか. More...
bool | hasEffectNotBy (Player player, Piece piece, Square target) const
| 対象とするマスにあるプレイヤーの(ただしある駒以外)利きがあるかどうか. More...
bool | hasEffectByNotPinnedAndKing (Player pl, Square target) const
| {pinされている駒, 玉以外}からの利きがある. More...
bool | hasEffectByNotPinned (Player pl, Square target) const
| pinされている駒以外からの利きがある. More...
bool | hasMultipleEffectAt (Player player, Square target) const
| 二つ以上の駒から利きがある. More...
bool | hasEffectByPiece (Piece attack, Square target) const
| 駒attack が target に利きを持つか (旧hasEffectToと統合) More...
bool | hasEffectIf (PtypeO ptypeo, Square attacker, Square target) const
| attackerにptypeoの駒がいると仮定した場合にtargetに利きがあるかどうか を stateをupdateしないで確かめる. More...
template<Player P>
bool | hasEffectByWithRemove (Square target, Square removed) const
bool | hasEffectByWithRemove (Player player, Square target, Square removed) const
template<Ptype PTYPE>
const Piece | findAttackAt (Player attack, Square target) const
| return a piece s.t. More...
template<Ptype PTYPE>
const Piece | findAttackAtStrict (Player attack, Square target) const
const Piece | findLongAttackAt (Player owner, int piece, Direction d) const
| pieceのd方向から長い利きがある場合にその駒を返す。 More...
const Piece | findLongAttackAt (Player owner, Piece piece, Direction d) const
const Piece | findLongAttackAt (Piece piece, Direction d) const
const Piece | findLongAttackAt (Square square, Direction d) const
const Piece | selectCheapPiece (PieceMask effect) const
| 利きの中から安そうな駒を選ぶ More...
const Piece | findCheapAttack (Player P, Square square) const
const Piece | findCheapAttackNotBy (Player P, Square square, const PieceMask &ignore) const
const Piece | findAttackNotBy (Player P, Square square, const PieceMask &ignore) const
template<Player P>
bool | findCheckPiece (Piece &attack_piece) const
| 王手駒を探す More...
bool | hasEffectAt (Player P, Square target, Piece &attackerPiece) const
template<Player P>
bool | hasEffectAt (Square target, Piece &attackerPiece) const
template<bool show_error>
bool | isAlmostValidMove (Move move) const
| 合法手かどうかを簡単に検査する．局面に依存するチェックのみ． ルール上指せない手である可能性がある場合は，isValidMove を用いる． More...
bool | isAlmostValidMove (Move move, bool show_error=true) const
void | makeMove (Move move)
void | makeMovePass ()
template<class Function >
void | makeUnmakePass (Function &f)
template<class Function >
void | makeUnmakeMove (Move move, Function &f)
template<Player P, class Function >
void | makeUnmakeMove (Player2Type< P > player, Move move, Function &f)
bool | wasCheckEvasion (Move last_move) const
template<Player P, Ptype T, typename F >
void | forEachOnBoard (F &func) const
| T は isBasic でなくても動くが unpromote(T) の結果と同じ. More...
template<Player P, Ptype T, typename F >
void | forEachOnBoardPtypeStrict (F &func) const
| T の成不成を区別 More...
template<Player P, class Action >
void | forEachEffect (Square sq, Action &action) const
| sq への利きを持つ各駒に関して処理を行う. More...
template<Player P, class Action >
void | forEachEffect (Square sq, Action &action, const PieceMask &pin) const
| sq にある駒を取る move を生成して action の member を呼び出す. More...
template<Player P, class Action >
void | forEachEffectNotBy (Square sq, Piece piece, Action &action) const
| sq に移動する move を生成して action の member を呼び出す More...
template<Player P, Ptype Type, class Action >
void | forEachEffectOfPiece (Square pieceSquare, Action &action) const
| pieceSquareにある駒によって利きを受けるすべてのsquare (空白含む)について actionを実行する More...
template<class Action >
void | forEachEffectOfPiece (Piece piece, Action &action) const
template<osl::Player P, typename Function >
void | doUndoSimpleMove (Player2Type< P > player, Square from, Square to, int promoteMask, Function &func)
template<osl::Player P, typename Function >
void | doUndoDropMove (Player2Type< P > player, Square to, Ptype ptype, Function &func)
template<osl::Player P, typename Function >
void | doUndoCaptureMove (Player2Type< P > player, Square from, Square to, Piece target, int promoteMask, Function &func)
template<class Action >
void | forEachEffectOfPiece (Piece piece, Action &action) const
template<osl::Player P, osl::Ptype Type, class Action >
void | forEachEffectOfPiece (Square pieceSquare, Action &action) const
template<osl::Player P>
bool | hasEffectByWithRemove (Square target, Square removed) const
Public Member Functions inherited from osl::state::SimpleState
| SimpleState ()
| SimpleState (Handicap h)
virtual | ~SimpleState ()
void | init ()
| 盤面が空の状態に初期化 More...
void | init (Handicap h)
| ハンディに応じた初期状態に初期化 More...
void | initPawnMask ()
const Piece | pieceOf (int num) const
void | setPieceOf (int num, Piece p)
template<Player P>
const Piece | kingPiece () const
const Piece | kingPiece (Player P) const
template<Player P>
Square | kingSquare () const
Square | kingSquare (Player player) const
template<Ptype PTYPE>
const Piece | nth (int n) const
| unpromote(PTYPE)のn番目の駒を帰す. More...
void | setBoard (Square sq, Piece piece)
const PieceMask & | standMask (Player p) const
const PieceMask & | usedMask () const
bool | isOffBoard (int num) const
void | clearPawn (Player pl, Square sq)
| (internal) More...
void | setPawn (Player pl, Square sq)
| (internal) More...
bool | isPawnMaskSet (Player player, int x) const
template<Player P>
bool | isPawnMaskSet (int x) const
bool | canDropPawnTo (Player player, int x) const
| xの筋に歩を打てる More...
void | setPiece (Player player, Square sq, Ptype ptype)
void | setPieceAll (Player player)
const Piece | pieceAt (Square sq) const
const Piece | operator[] (Square sq) const
const Piece * | getPiecePtr (Square sq) const
const Piece | pieceOnBoard (Square sq) const
bool | isOnBoard (int num) const
int | countPiecesOnStand (Player pl, Ptype ptype) const
| 持駒の枚数を数える More...
template<Ptype Type>
int | countPiecesOnStand (Player pl) const
| 後方互換 More...
bool | hasPieceOnStand (Player player, Ptype ptype) const
template<Ptype T>
bool | hasPieceOnStand (Player P) const
Piece | nextPiece (Square cur, Offset diff) const
| diff方向にあるPiece を求める. More...
void | setTurn (Player player)
Player | turn () const
void | changeTurn ()
| 手番を変更する More...
bool | isConsistent (bool show_error=true) const
template<bool show_error>
bool | isAlmostValidMove (Move move) const
| エラー表示をするかどうかをtemplateパラメータにした高速化版 More...
bool | isAlmostValidMove (Move move, bool show_error=true) const
| 合法手かどうかを簡単に検査する．局面に依存するチェックのみ． ルール上指せない手である可能性がある場合は，isValidMove を用いる． More...
bool | isValidMove (Move move, bool show_error=true) const
| 合法手かどうかを検査する． isValidMoveByRule, isAlmostValidMove をおこなう． 玉の素抜きや王手を防いでいるか， 千日手，打歩詰かどうかは検査しない． More...
bool | isEmptyBetween (Square from, Square to, Offset offset, bool pieceExistsAtTo=false) const
bool | isEmptyBetween (Square from, Square to, bool noSpaceAtTo=false) const
bool | dump () const
| dump: 自分を cerr に表示する。abort 前などにデバッグに使う More...
const SimpleState | emulateCapture (Piece from, Player new_owner) const
| from で表現されたPieceをnew_ownerの持駒にした局面を作る. More...
const SimpleState | emulateHandPiece (Player from, Player to, Ptype ptype) const
| from からto に ptypeの持駒を一枚渡した局面を作る. More...
const SimpleState | rotate180 () const
const SimpleState | flipHorizontal () const
template<bool show_error>
bool | isAlmostValidDrop (Move move) const
template<bool show_error>
bool | testValidityOtherThanEffect (Move move) const
template<bool show_error>
bool | isAlmostValidMove (Move move) const

## Private Types
typedef NumEffectState | state_t

## Private Member Functions
template<Player P, class Action >
void | forEachEffect (const PieceMask &pieces, Square sq, Action &action) const
template<Player P, Ptype Type, class Action , Direction Dir>
void | forEachEffectOfPieceDir (Square, Action &, Int2Type< false >) const
template<Player P, Ptype Type, class Action , Direction Dir>
void | forEachEffectOfPieceDir (Square pieceSquare, Action &action, Int2Type< true >) const
template<Player P, Ptype Type, class Action , Direction Dir>
void | forEachEffectOfPieceDir (Square pieceSquare, Action &action) const
template<Player P, Ptype Type, class Action , Direction Dir>
void | forEachEffectOfPieceLongDir (Square, Action &, Int2Type< false >) const
template<Player P, Ptype Type, class Action , Direction Dir>
void | forEachEffectOfPieceLongDir (Square pieceSquare, Action &action, Int2Type< true >) const
template<Player P, Ptype Type, class Action , Direction Dir>
void | forEachEffectOfPieceLongDir (Square pieceSquare, Action &action) const
void | doSimpleMove (Square from, Square to, int promoteMask)
void | doDropMove (Square to, Ptype ptype)
void | doCaptureMove (Square from, Square to, Piece target, int promoteMask)
template<Player P, class Function >
void | doUndoSimpleMove (Player2Type< P > player, Square from, Square to, int promoteMask, Function &func)
template<Player P>
void | prologueSimple (Player2Type< P >, Square from, Square to, int promoteMask, Piece &oldPiece, int &num, PtypeO &oldPtypeO, PtypeO &new_ptypeo, CArray< PieceMask, 2 > &pin_or_open_backup, KingMobility &king_mobility_backup, PieceMask &promoted_backup, CArray< PieceMask, 2 > &effected_mask_backup, CArray< PieceMask, 2 > &effected_changed_mask_backup, CArray< uint64_t, 2 > &king8infos_backup, MobilityTable &mobility_backup)
void | epilogueSimple (Square from, Square to, Piece oldPiece, int num, PtypeO oldPtypeO, PtypeO newPtypeO, const CArray< PieceMask, 2 > &pin_or_open_backup, const KingMobility &king_mobility_backup, const PieceMask &promoted_backup, const CArray< PieceMask, 2 > &effected_mask_backup, const CArray< PieceMask, 2 > &effected_changed_mask_backup, const CArray< uint64_t, 2 > &king8infos_backup, const MobilityTable &mobility_backup)
template<Player P, class Function >
void | doUndoDropMove (Player2Type< P > player, Square to, Ptype ptype, Function &func)
template<Player P>
void | prologueDrop (Player2Type< P >, Square to, Ptype ptype, Piece &oldPiece, int &num, PtypeO &ptypeO, int &numIndex, mask_t &numMask, CArray< PieceMask, 2 > &pin_or_open_backup, KingMobility &king_mobility_backup, CArray< PieceMask, 2 > &effected_mask_backup, CArray< PieceMask, 2 > &effected_changed_mask_backup, CArray< uint64_t, 2 > &king8infos_backup, MobilityTable &mobility_backup)
template<Player P>
void | epilogueDrop (Player2Type< P >, Square to, Ptype ptype, Piece oldPiece, int num, PtypeO ptypeO, int numIndex, mask_t numMask, const CArray< PieceMask, 2 > &pin_or_open_backup, const KingMobility &king_mobility_backup, const CArray< PieceMask, 2 > &effected_mask_backup, const CArray< PieceMask, 2 > &effected_changed_mask_backup, const CArray< uint64_t, 2 > &king8infos_backup, const MobilityTable &mobility_backup)
template<Player P, class Function >
void | doUndoCaptureMove (Player2Type< P > player, Square from, Square to, Piece target, int promoteMask, Function &func)
template<Player P>
void | prologueCapture (Player2Type< P >, Square from, Square to, Piece target, int promoteMask, Piece &oldPiece, PtypeO &oldPtypeO, PtypeO &capturePtypeO, PtypeO &new_ptypeo, int &num0, int &num1, int &num1Index, mask_t &num1Mask, CArray< PieceMask, 2 > &pin_or_open_backup, KingMobility &king_mobility_backup, PieceMask &promoted_backup, CArray< PieceMask, 2 > &effected_mask_backup, CArray< PieceMask, 2 > &effected_changed_mask_backup, CArray< uint64_t, 2 > &king8infos_backup, MobilityTable &mobility_backup)
template<Player P>
void | epilogueCapture (Player2Type< P >, Square from, Square to, Piece target, Piece oldPiece, PtypeO oldPtypeO, PtypeO capturePtypeO, PtypeO newPtypeO, int num0, int num1, int num1Index, mask_t num1Mask, const CArray< PieceMask, 2 > &pin_or_open_backup, const KingMobility &king_mobility_backup, const PieceMask &promoted_backup, const CArray< PieceMask, 2 > &effected_mask_backup, const CArray< PieceMask, 2 > &effected_changed_mask_backup, const CArray< uint64_t, 2 > &king8infos_backup, const MobilityTable &mobility_backup)
template<Direction DIR>
void | makePinOpenDir (Square target, PieceMask &pins, PieceMask const &onBoard, Player defense)
void | recalcPinOpen (Square changed, Direction &lastDir, Player defense)
PieceMask | makePinOpen (Square target, Player defense)
void | makePinOpen (Player defense)
template<Player P>
void | makeKing8Info ()

## Private Attributes
effect::NumSimpleEffectTable | effects
CArray< PieceMask, 2 > | pieces_onboard
PieceMask | promoted
| 成駒一覧 More...
CArray< PieceMask, 2 > | pin_or_open
KingMobility | king_mobility
CArray< uint64_t, 2 > | king8infos

## Friends
bool | operator== (const NumEffectState &st1, const NumEffectState &st2)
| 駒番に依存した局面（インスタンス）比較をする. More...

## Additional Inherited Members
Static Public Member Functions inherited from osl::state::SimpleState
template<Ptype PTYPE>
static int | nthLimit ()
static bool | isValidMoveByRule (Move move, bool show_error)
| 盤面以外の部分の反則のチェック More...
Static Public Attributes inherited from osl::state::SimpleState
static const bool | hasPawnMask =true
Protected Member Functions inherited from osl::state::SimpleState
PieceMask & | standMask (Player p)
template<bool show_error>
bool | isAlmostValidDrop (Move move) const
template<bool show_error>
bool | testValidityOtherThanEffect (Move move) const
Protected Attributes inherited from osl::state::SimpleState
CArray< Piece, Square::SIZE > | board
CArray< Piece, Piece::SIZE > | pieces
| 全てのpieceが登録されている More...
CArray< PieceMask, 2 > | stand_mask
CArray< BitXmask, 2 > | pawnMask
CArray< CArray< char, PTYPE_SIZE-PTYPE_BASIC_MIN >, 2 > | stand_count
Player | player_to_move
| 手番 More...
PieceMask | used_mask

## Detailed Description

利きを持つ局面

- effects (NumSimpleEffectTable) 利き
- pieces_onboard (PieceMask) 盤上にある駒

Definition at line 32 of file numEffectState.h.

## Member Typedef Documentation

typedef NumEffectState osl::state::NumEffectState::state_t
| private

Definition at line 46 of file numEffectState.h.

## Constructor & Destructor Documentation

osl::state::NumEffectState::NumEffectState | ( | const state::SimpleState & | st = `SimpleState(HIRATE)`) |  |
| explicit

Definition at line 51 of file numEffectState.cc.

References osl::BLACK, osl::effect::NumSimpleEffectTable::effected_changed_mask, osl::effect::NumSimpleEffectTable::effected_mask, effects, hasEffectAt(), osl::indexToPlayer(), osl::state::SimpleState::isOnBoard(), osl::Piece::isOnBoard(), osl::Piece::isPromoted(), makePinOpen(), osl::Piece::owner(), osl::state::SimpleState::pieceOf(), pieces_onboard, promoted, osl::Piece::square(), and osl::WHITE.

osl::state::NumEffectState::~NumEffectState | ( | ) |  |

Definition at line 85 of file numEffectState.cc.

## Member Function Documentation

template<Ptype PTYPE>

const mask_t osl::state::NumEffectState::allEffectAt | ( | Player | P,
|  | Square | target
| ) |  | const
| inline

Definition at line 270 of file numEffectState.h.

References effectSetAt(), and piecesOnBoard().

const osl::mask_t osl::state::NumEffectState::allEffectAt | ( | Player | P,
|  | Ptype | ptype,
|  | Square | target
| ) |  | const

Definition at line 897 of file numEffectState.cc.

References osl::BISHOP, osl::GOLD, osl::KING, osl::KNIGHT, osl::LANCE, osl::PAWN, osl::PBISHOP, osl::PKNIGHT, osl::PLANCE, osl::PPAWN, osl::PROOK, osl::PSILVER, osl::ROOK, osl::SILVER, and target.

template<Ptype PTYPE>

bool osl::state::NumEffectState::anyEffectChanged | ( | ) |  | const
| inline

Definition at line 136 of file numEffectState.h.

References changedPieces().

const BoardMask osl::state::NumEffectState::changedEffects | ( | Player | pl) |  | const
| inline

Definition at line 121 of file numEffectState.h.

References osl::effect::NumSimpleEffectTable::changedEffects(), effects, and hasChangedEffects().

Referenced by osl::eval::ml::King8EffectBase::evalWithUpdateCommon().

const BoardMask osl::state::NumEffectState::changedEffects | ( | ) |  | const
| inline

Definition at line 125 of file numEffectState.h.

References osl::BLACK, and osl::WHITE.

const NumBitmapEffect osl::state::NumEffectState::changedPieces | ( | ) |  | const
| inline

Definition at line 129 of file numEffectState.h.

References osl::effect::NumSimpleEffectTable::changedPieces(), and effects.

Referenced by anyEffectChanged(), and longEffectChanged().

const PieceMask osl::state::NumEffectState::checkShadow | ( | Player | attack) |  | const
| inline

attack の駒で動くと開き王手になる可能性がある集合

Definition at line 72 of file numEffectState.h.

References osl::alt(), piecesOnBoard(), and pin_or_open.

void osl::state::NumEffectState::copyFrom | ( | const NumEffectState & | src) |  |

主要部分を高速にコピーする.

盤の外はコピーされない

Definition at line 922 of file numEffectState.cc.

References osl::state::SimpleState::board, effects, osl::Square::index(), king8infos, king_mobility, osl::state::SimpleState::pawnMask, osl::state::SimpleState::pieces, pieces_onboard, pin_or_open, osl::state::SimpleState::player_to_move, promoted, osl::state::SimpleState::stand_count, osl::state::SimpleState::stand_mask, and osl::state::SimpleState::used_mask.

void osl::state::NumEffectState::copyFrom | ( | const SimpleState & | src) |  |

Definition at line 1038 of file numEffectState.cc.

int osl::state::NumEffectState::countEffect | ( | Player | player,
|  | Square | target
| ) |  | const
| inline

利きの数を数える.

targetが盤をはみ出してはいけない

Definition at line 243 of file numEffectState.h.

References effectSetAt(), and osl::Square::isOnBoard().

Referenced by osl::eval::ml::King25Effect::countEffectAndPieces(), osl::eval::ml::King25EffectBoth::countEffectAndPiecesBoth(), and osl::enter_king::countEffectInRange().

int osl::state::NumEffectState::countEffect | ( | Player | player,
|  | Square | target,
|  | PieceMask | pins
| ) |  | const
| inline

利きの数を数える.

targetが盤をはみ出してはいけない

Parameters

  pins | この駒の利きは数えない

Definition at line 257 of file numEffectState.h.

References effectSetAt(), and osl::Square::isOnBoard().

void osl::state::NumEffectState::doCaptureMove | ( | Square | from,
|  | Square | to,
|  | Piece | target,
|  | int | promoteMask
| ) |  |
| private

Definition at line 252 of file numEffectState.cc.

References osl::alt(), osl::BLACK, osl::newPtypeO(), osl::PAWN, and osl::Piece::ptype().

void osl::state::NumEffectState::doDropMove | ( | Square | to,
|  | Ptype | ptype
| ) |  |
| private

Definition at line 285 of file numEffectState.cc.

References osl::BLACK, and osl::PAWN.

void osl::state::NumEffectState::doSimpleMove | ( | Square | from,
|  | Square | to,
|  | int | promoteMask
| ) |  |
| private

Definition at line 224 of file numEffectState.cc.

References osl::BLACK, and osl::newPtypeO().

template<Player P, class Function >

void osl::state::NumEffectState::doUndoCaptureMove | ( | Player2Type< P > | player,
|  | Square | from,
|  | Square | to,
|  | Piece | target,
|  | int | promoteMask,
|  | Function & | func
| ) |  |
| private

Referenced by makeUnmakeMove().

template<osl::Player P, typename Function >

void osl::state::NumEffectState::doUndoCaptureMove | ( | Player2Type< P > | player,
|  | Square | from,
|  | Square | to,
|  | Piece | target,
|  | int | promoteMask,
|  | Function & | func
| ) |  |

Definition at line 1062 of file numEffectState.h.

References osl::newPtypeO(), osl::PAWN, and osl::Piece::ptype().

template<Player P, class Function >

void osl::state::NumEffectState::doUndoDropMove | ( | Player2Type< P > | player,
|  | Square | to,
|  | Ptype | ptype,
|  | Function & | func
| ) |  |
| private

Referenced by makeUnmakeMove().

template<osl::Player P, typename Function >

void osl::state::NumEffectState::doUndoDropMove | ( | Player2Type< P > | player,
|  | Square | to,
|  | Ptype | ptype,
|  | Function & | func
| ) |  |

Definition at line 1022 of file numEffectState.h.

References osl::PAWN.

template<Player P, class Function >

void osl::state::NumEffectState::doUndoSimpleMove | ( | Player2Type< P > | player,
|  | Square | from,
|  | Square | to,
|  | int | promoteMask,
|  | Function & | func
| ) |  |
| private

Referenced by makeUnmakeMove().

template<osl::Player P, typename Function >

void osl::state::NumEffectState::doUndoSimpleMove | ( | Player2Type< P > | player,
|  | Square | from,
|  | Square | to,
|  | int | promoteMask,
|  | Function & | func
| ) |  |

Definition at line 979 of file numEffectState.h.

References osl::newPtypeO().

const PieceMask osl::state::NumEffectState::effectedChanged | ( | Player | pl) |  | const
| inline

前の指手でeffectedMask(pl)が変化したか.

取られた駒は現在の実装ではリストされないようだ.

Definition at line 114 of file numEffectState.h.

References osl::effect::NumSimpleEffectTable::effected_changed_mask, and effects.

Referenced by isConsistent().

const PieceMask osl::state::NumEffectState::effectedMask | ( | Player | pl) |  | const
| inline

pl からの利きが(1つ以上)ある駒一覧

Definition at line 107 of file numEffectState.h.

References osl::effect::NumSimpleEffectTable::effected_mask, and effects.

Referenced by osl::eval::ml::King25EffectBoth::countEffectAndPiecesBoth(), and isConsistent().

const NumBitmapEffect osl::state::NumEffectState::effectSetAt | ( | Square | sq) |  | const
| inline

Definition at line 235 of file numEffectState.h.

References effects, and osl::effect::NumSimpleEffectTable::effectSetAt().

Referenced by allEffectAt(), countEffect(), osl::eval::ml::King25Effect::countEffectAndPieces(), osl::eval::ml::King25EffectBoth::countEffectAndPiecesBoth(), findAttackNotBy(), findCheapAttack(), findCheapAttackNotBy(), forEachEffect(), forEachEffectNotBy(), hasEffectAt(), hasEffectByNotPinned(), hasEffectByNotPinnedAndKing(), hasEffectByPiece(), hasEffectInDirection(), hasEffectNotBy(), hasMultipleEffectAt(), isConsistent(), and longEffectAt().

template<osl::Player P>

template void osl::NumEffectState::epilogueCapture | ( | Player2Type< P > | ,
|  | Square | from,
|  | Square | to,
|  | Piece | target,
|  | Piece | oldPiece,
|  | PtypeO | oldPtypeO,
|  | PtypeO | capturePtypeO,
|  | PtypeO | newPtypeO,
|  | int | num0,
|  | int | num1,
|  | int | num1Index,
|  | mask_t | num1Mask,
|  | const CArray< PieceMask, 2 > & | pin_or_open_backup,
|  | const KingMobility & | king_mobility_backup,
|  | const PieceMask & | promoted_backup,
|  | const CArray< PieceMask, 2 > & | effected_mask_backup,
|  | const CArray< PieceMask, 2 > & | effected_changed_mask_backup,
|  | const CArray< uint64_t, 2 > & | king8infos_backup,
|  | const MobilityTable & | mobility_backup
| ) |  |
| private

Definition at line 618 of file numEffectState.cc.

References osl::getPtype(), osl::newPtypeO(), osl::PTYPE_BASIC_MIN, and osl::unpromote().

template<osl::Player P>

template void osl::NumEffectState::epilogueDrop | ( | Player2Type< P > | ,
|  | Square | to,
|  | Ptype | ptype,
|  | Piece | oldPiece,
|  | int | num,
|  | PtypeO | ptypeO,
|  | int | numIndex,
|  | mask_t | numMask,
|  | const CArray< PieceMask, 2 > & | pin_or_open_backup,
|  | const KingMobility & | king_mobility_backup,
|  | const CArray< PieceMask, 2 > & | effected_mask_backup,
|  | const CArray< PieceMask, 2 > & | effected_changed_mask_backup,
|  | const CArray< uint64_t, 2 > & | king8infos_backup,
|  | const MobilityTable & | mobility_backup
| ) |  |
| private

Definition at line 495 of file numEffectState.cc.

References osl::Piece::EMPTY(), and osl::PTYPE_BASIC_MIN.

void osl::state::NumEffectState::epilogueSimple | ( | Square | from,
|  | Square | to,
|  | Piece | oldPiece,
|  | int | num,
|  | PtypeO | oldPtypeO,
|  | PtypeO | newPtypeO,
|  | const CArray< PieceMask, 2 > & | pin_or_open_backup,
|  | const KingMobility & | king_mobility_backup,
|  | const PieceMask & | promoted_backup,
|  | const CArray< PieceMask, 2 > & | effected_mask_backup,
|  | const CArray< PieceMask, 2 > & | effected_changed_mask_backup,
|  | const CArray< uint64_t, 2 > & | king8infos_backup,
|  | const MobilityTable & | mobility_backup
| ) |  |
| private

Definition at line 393 of file numEffectState.cc.

References osl::Piece::EMPTY(), and osl::newPtypeO().

template<Ptype PTYPE>

const Piece osl::state::NumEffectState::findAttackAt | ( | Player | attack,
|  | Square | target
| ) |  | const
| inline

return a piece s.t.

owner == attack, ptype == PTYPE, has effect on target. return Piece::EMPTY() otherwise

Definition at line 480 of file numEffectState.h.

References osl::Piece::EMPTY(), osl::state::SimpleState::pieceOf(), and target.

template<Ptype PTYPE>

const Piece osl::state::NumEffectState::findAttackAtStrict | ( | Player | attack,
|  | Square | target
| ) |  | const
| inline

Definition at line 488 of file numEffectState.h.

References osl::Piece::EMPTY(), osl::isPromoted(), osl::state::SimpleState::pieceOf(), promoted, and target.

const Piece osl::state::NumEffectState::findAttackNotBy | ( | Player | P,
|  | Square | square,
|  | const PieceMask & | ignore
| ) |  | const
| inline

Definition at line 552 of file numEffectState.h.

References effectSetAt(), osl::Piece::EMPTY(), osl::state::SimpleState::pieceOf(), osl::state::SimpleState::pieces, and piecesOnBoard().

const Piece osl::state::NumEffectState::findCheapAttack | ( | Player | P,
|  | Square | square
| ) |  | const
| inline

Parameters

  P | - 利きをつけている側のプレイヤ
  square | - 調査する場所

Returns
  利きを付けている中で安そうな駒 (複数の場合でもEMPTYにはしない)

Definition at line 537 of file numEffectState.h.

References effectSetAt(), piecesOnBoard(), and selectCheapPiece().

const Piece osl::state::NumEffectState::findCheapAttackNotBy | ( | Player | P,
|  | Square | square,
|  | const PieceMask & | ignore
| ) |  | const
| inline

Parameters

  P | - 利きをつけている側のプレイヤ
  square | - 調査する場所

Returns
  利きを付けている中で安そうな駒 (複数の場合でもEMPTYにはしない)

Definition at line 546 of file numEffectState.h.

References effectSetAt(), osl::state::SimpleState::pieces, piecesOnBoard(), and selectCheapPiece().

template<Player P>

bool osl::state::NumEffectState::findCheckPiece | ( | Piece & | attack_piece) |  | const
| inline

王手駒を探す

Returns
  王手かどうか

Parameters

  attack_piece | 一つの駒による王手の場合はattck_pieceにその駒を入れる 複数の駒による王手の場合はPiece::EMPTY()を入れる
  P(template) | 玉

Definition at line 570 of file numEffectState.h.

References osl::state::SimpleState::kingSquare().

const Piece osl::state::NumEffectState::findLongAttackAt | ( | Player | owner,
|  | int | piece,
|  | Direction | d
| ) |  | const
| inline

pieceのd方向から長い利きがある場合にその駒を返す。

Parameters

  d | piece からみた向き

Definition at line 503 of file numEffectState.h.

References osl::BLACK, osl::effect::NumSimpleEffectTable::effectedNumTable, effects, osl::Piece::EMPTY(), osl::EMPTY_NUM, osl::inverse(), and osl::state::SimpleState::pieceOf().

Referenced by findLongAttackAt().

const Piece osl::state::NumEffectState::findLongAttackAt | ( | Player | owner,
|  | Piece | piece,
|  | Direction | d
| ) |  | const
| inline

Definition at line 513 of file numEffectState.h.

References findLongAttackAt(), osl::Piece::isPiece(), osl::Piece::number(), and osl::Piece::owner().

const Piece osl::state::NumEffectState::findLongAttackAt | ( | Piece | piece,
|  | Direction | d
| ) |  | const
| inline

Definition at line 519 of file numEffectState.h.

References findLongAttackAt(), osl::Piece::isPiece(), and osl::Piece::owner().

const Piece osl::state::NumEffectState::findLongAttackAt | ( | Square | square,
|  | Direction | d
| ) |  | const
| inline

Definition at line 524 of file numEffectState.h.

References findLongAttackAt(), and osl::state::SimpleState::pieceOnBoard().

const osl::Piece osl::state::NumEffectState::findThreatenedPiece | ( | Player | P) |  | const

取られそうなPの駒で価値が最大のもの

Definition at line 131 of file numEffectState.cc.

References osl::alt(), osl::Piece::EMPTY(), osl::PtypeTable::getMaskLow(), osl::PieceTable::getPtypeOf(), osl::LANCE, osl::eval::max(), osl::PAWN, osl::Piece_Table, and osl::Ptype_Table.

template<Player P, class Action >

void osl::state::NumEffectState::forEachEffect | ( | const PieceMask & | pieces,
|  | Square | sq,
|  | Action & | action
| ) |  | const
| inlineprivate

Definition at line 730 of file numEffectState.h.

References osl::state::SimpleState::pieceOf().

template<Player P, class Action >

void osl::state::NumEffectState::forEachEffect | ( | Square | sq,
|  | Action & | action
| ) |  | const
| inline

sq への利きを持つ各駒に関して処理を行う.

Parameters

  action | たとえば AlwaysMoveAction

Definition at line 760 of file numEffectState.h.

References effectSetAt(), and piecesOnBoard().

template<Player P, class Action >

void osl::state::NumEffectState::forEachEffect | ( | Square | sq,
|  | Action & | action,
|  | const PieceMask & | pin
| ) |  | const
| inline

sq にある駒を取る move を生成して action の member を呼び出す.

Parameters

  pin | 無視する駒
  action | たとえば AlwaysMoveAction

Definition at line 771 of file numEffectState.h.

References effectSetAt(), and piecesOnBoard().

template<Player P, class Action >

void osl::state::NumEffectState::forEachEffectNotBy | ( | Square | sq,
|  | Piece | piece,
|  | Action & | action
| ) |  | const
| inline

sq に移動する move を生成して action の member を呼び出す

Parameters

  action | たとえば AlwayMoveAction
  piece | これ以外の駒を使う

Definition at line 784 of file numEffectState.h.

References effectSetAt(), osl::Piece::number(), osl::state::SimpleState::pieces, and piecesOnBoard().

template<Player P, Ptype Type, class Action >

void osl::state::NumEffectState::forEachEffectOfPiece | ( | Square | pieceSquare,
|  | Action & | action
| ) |  | const

pieceSquareにある駒によって利きを受けるすべてのsquare (空白含む)について actionを実行する

SimpleState より移植: ImmediateAddSupportがなければ消せる

template<class Action >

void osl::state::NumEffectState::forEachEffectOfPiece | ( | Piece | piece,
|  | Action & | action
| ) |  | const

template<class Action >

void osl::state::NumEffectState::forEachEffectOfPiece | ( | Piece | piece,
|  | Action & | action
| ) |  | const

Definition at line 1124 of file numEffectState.h.

References osl::BISHOP, osl::BLACK, osl::GOLD, osl::KING, osl::KNIGHT, osl::LANCE, NEW_PTYPEO, osl::PAWN, osl::PBISHOP, osl::PKNIGHT, osl::PLANCE, osl::PPAWN, osl::PROOK, osl::PSILVER, osl::Piece::ptypeO(), osl::ROOK, osl::SILVER, osl::Piece::square(), and osl::WHITE.

template<osl::Player P, osl::Ptype Type, class Action >

void osl::state::NumEffectState::forEachEffectOfPiece | ( | Square | pieceSquare,
|  | Action & | action
| ) |  | const

Definition at line 1162 of file numEffectState.h.

template<Player P, Ptype Type, class Action , Direction Dir>

void osl::state::NumEffectState::forEachEffectOfPieceDir | ( | Square | ,
|  | Action & | ,
|  | Int2Type< false > |
| ) |  | const
| inlineprivate

Definition at line 792 of file numEffectState.h.

template<Player P, Ptype Type, class Action , Direction Dir>

void osl::state::NumEffectState::forEachEffectOfPieceDir | ( | Square | pieceSquare,
|  | Action & | action,
|  | Int2Type< true > |
| ) |  | const
| inlineprivate

Definition at line 794 of file numEffectState.h.

References osl::state::SimpleState::pieceAt().

template<Player P, Ptype Type, class Action , Direction Dir>

void osl::state::NumEffectState::forEachEffectOfPieceDir | ( | Square | pieceSquare,
|  | Action & | action
| ) |  | const
| inlineprivate

Definition at line 800 of file numEffectState.h.

template<Player P, Ptype Type, class Action , Direction Dir>

void osl::state::NumEffectState::forEachEffectOfPieceLongDir | ( | Square | ,
|  | Action & | ,
|  | Int2Type< false > |
| ) |  | const
| inlineprivate

Definition at line 804 of file numEffectState.h.

template<Player P, Ptype Type, class Action , Direction Dir>

void osl::state::NumEffectState::forEachEffectOfPieceLongDir | ( | Square | pieceSquare,
|  | Action & | action,
|  | Int2Type< true > |
| ) |  | const
| inlineprivate

Definition at line 806 of file numEffectState.h.

References osl::Offset::intValue(), osl::Piece::isEmpty(), and osl::state::SimpleState::pieceAt().

template<Player P, Ptype Type, class Action , Direction Dir>

void osl::state::NumEffectState::forEachEffectOfPieceLongDir | ( | Square | pieceSquare,
|  | Action & | action
| ) |  | const
| inlineprivate

Definition at line 817 of file numEffectState.h.

template<Player P, Ptype T, typename F >

void osl::state::NumEffectState::forEachOnBoard | ( | F & | func) |  | const
| inline

T は isBasic でなくても動くが unpromote(T) の結果と同じ.

Definition at line 703 of file numEffectState.h.

References osl::state::SimpleState::pieceOf(), and piecesOnBoard().

template<Player P, Ptype T, typename F >

void osl::state::NumEffectState::forEachOnBoardPtypeStrict | ( | F & | func) |  | const
| inline

T の成不成を区別

Definition at line 715 of file numEffectState.h.

References osl::isPromoted(), osl::state::SimpleState::pieceOf(), piecesOnBoard(), and promoted.

bool osl::state::NumEffectState::hasChangedEffects | ( | ) |  | const
| inline

Definition at line 118 of file numEffectState.h.

References osl::BLACK, osl::effect::NumSimpleEffectTable::changedEffects(), and effects.

Referenced by changedEffects().

template<Player P>

bool osl::state::NumEffectState::hasEffectAt | ( | Square | target) |  | const
| inline

対象とするマスにあるプレイヤーの利きがあるかどうか.

Parameters

  player | 攻撃側
  target | 対象のマス

Definition at line 301 of file numEffectState.h.

References effectSetAt(), and osl::Square::isOnBoard().

Referenced by osl::eval::ml::SilverFeatures::canRetreat(), osl::eval::ml::GoldFeatures::canRetreat(), inCheck(), main(), and NumEffectState().

bool osl::state::NumEffectState::hasEffectAt | ( | Player | player,
|  | Square | target
| ) |  | const
| inline

対象とするマスにあるプレイヤーの利きがあるかどうか.

Parameters

  player | 攻撃側
  target | 対象のマス

Definition at line 312 of file numEffectState.h.

References effectSetAt(), and osl::Square::isOnBoard().

bool osl::state::NumEffectState::hasEffectAt | ( | Player | P,
|  | Square | target,
|  | Piece & | attackerPiece
| ) |  | const
| inline

Definition at line 574 of file numEffectState.h.

References osl::BLACK, and target.

template<Player P>

bool osl::state::NumEffectState::hasEffectAt | ( | Square | target,
|  | Piece & | attackerPiece
| ) |  | const
| inline

Parameters

  P(template) | - 利きをつけている側のプレイヤ
  target | - 利きをつけられた場所
  attackerPiece | - multiple attackの場合はPiece::EMPTY() そうでないなら利きをつけている駒を返す

Definition at line 588 of file numEffectState.h.

References effectSetAt(), osl::Piece::EMPTY(), osl::state::SimpleState::pieceOf(), and piecesOnBoard().

bool osl::state::NumEffectState::hasEffectByNotPinned | ( | Player | pl,
|  | Square | target
| ) |  | const
| inline

pinされている駒以外からの利きがある.

Definition at line 405 of file numEffectState.h.

References effectSetAt(), osl::Square::isOnBoard(), piecesOnBoard(), and pinOrOpen().

bool osl::state::NumEffectState::hasEffectByNotPinnedAndKing | ( | Player | pl,
|  | Square | target
| ) |  | const
| inline

{pinされている駒, 玉以外}からの利きがある.

Definition at line 396 of file numEffectState.h.

References effectSetAt(), osl::Square::isOnBoard(), osl::KING, piecesOnBoard(), and pinOrOpen().

bool osl::state::NumEffectState::hasEffectByPiece | ( | Piece | attack,
|  | Square | target
| ) |  | const
| inline

駒attack が target に利きを持つか (旧hasEffectToと統合)

Parameters

  target | 対象のマス

Definition at line 427 of file numEffectState.h.

References effectSetAt(), osl::Square::isOnBoard(), osl::Piece::isPiece(), and osl::Piece::number().

template<Ptype PTYPE>

bool osl::state::NumEffectState::hasEffectByPtype | ( | Player | attack,
|  | Square | target
| ) |  | const
| inline

target に ptype の利きがあるか? 成不成を区別しない

Definition at line 332 of file numEffectState.h.

References target.

template<Ptype PTYPE>

bool osl::state::NumEffectState::hasEffectByPtypeStrict | ( | Player | attack,
|  | Square | target
| ) |  | const
| inline

target に ptype の利きがあるか? 成不成を区別

Definition at line 340 of file numEffectState.h.

References osl::isPromoted(), promoted, and target.

template<osl::Player P>

bool osl::state::NumEffectState::hasEffectByWithRemove | ( | Square | target,
|  | Square | removed
| ) |  | const

Definition at line 12 of file numEffectState.tcc.

References osl::BLACK, osl::Board_Table, osl::BoardTable::getLongDirection(), osl::isLong(), osl::Piece::isPiece(), osl::longToShort(), osl::Piece::number(), and osl::Piece::owner().

template<Player P>

bool osl::state::NumEffectState::hasEffectByWithRemove | ( | Square | target,
|  | Square | removed
| ) |  | const

bool osl::state::NumEffectState::hasEffectByWithRemove | ( | Player | player,
|  | Square | target,
|  | Square | removed
| ) |  | const
| inline

Definition at line 467 of file numEffectState.h.

References osl::BLACK, and target.

bool osl::state::NumEffectState::hasEffectIf | ( | PtypeO | ptypeo,
|  | Square | attacker,
|  | Square | target
| ) |  | const
| inline

attackerにptypeoの駒がいると仮定した場合にtargetに利きがあるかどうか を stateをupdateしないで確かめる.

targetSquareは空白でも良い 盤上の駒を動かす事を検討しているときはに， 自分自身の陰に入って利かないと見なされることがある

Definition at line 442 of file numEffectState.h.

References osl::Board_Table, osl::PtypeTable::getEffect(), osl::BoardTable::getShortOffset(), osl::EffectContent::hasEffect(), osl::EffectContent::hasUnblockableEffect(), osl::state::SimpleState::isEmptyBetween(), osl::EffectContent::offset(), osl::Ptype_Table, and target.

template<Direction Dir, Player P>

bool osl::state::NumEffectState::hasEffectInDirection | ( | Square | to) |  | const
| inline

あるマスにあるDirectionでの長い利きがあるかどうか.

64bit版対応済み

Definition at line 354 of file numEffectState.h.

References osl::BLACK, osl::Board_Table, osl::BOOST_STATIC_ASSERT(), effectSetAt(), osl::BoardTable::getLongDirection(), osl::state::SimpleState::pieceOf(), pieces_onboard, piecesOnBoard(), and osl::Piece::square().

bool osl::state::NumEffectState::hasEffectNotBy | ( | Player | player,
|  | Piece | piece,
|  | Square | target
| ) |  | const
| inline

対象とするマスにあるプレイヤーの(ただしある駒以外)利きがあるかどうか.

Parameters

  player | 攻撃側
  piece | 攻撃側の駒
  target | 対象のマス

Definition at line 386 of file numEffectState.h.

References effectSetAt(), osl::Piece::number(), osl::Piece::owner(), pieces_onboard, and piecesOnBoard().

template<Ptype PTYPE>

bool osl::state::NumEffectState::hasLongEffectAt | ( | Player | P,
|  | Square | to
| ) |  | const
| inline

あるマスにPTYPEの長い利きがあるかどうか.

Definition at line 323 of file numEffectState.h.

References osl::BISHOP, osl::BOOST_STATIC_ASSERT(), osl::LANCE, and osl::ROOK.

bool osl::state::NumEffectState::hasMultipleEffectAt | ( | Player | player,
|  | Square | target
| ) |  | const
| inline

二つ以上の駒から利きがある.

そもそも利きがない場合も呼ばれる

Parameters

  player | 攻撃側
  target | 対象のマス

Definition at line 416 of file numEffectState.h.

References effectSetAt().

uint64_t osl::state::NumEffectState::Iking8Info | ( | Player | king) |  | const
| inline

Definition at line 80 of file numEffectState.h.

References king8infos.

Referenced by osl::eval::ml::King8EffectAll::eval().

bool osl::state::NumEffectState::inCheck | ( | Player | P) |  | const
| inline

Pの玉が王手状態

Definition at line 90 of file numEffectState.h.

References osl::alt(), hasEffectAt(), osl::Square::isPieceStand(), and osl::state::SimpleState::kingSquare().

bool osl::state::NumEffectState::inCheck | ( | ) |  | const
| inline

手番の玉が王手状態

Definition at line 100 of file numEffectState.h.

References inCheck(), and osl::state::SimpleState::turn().

Referenced by inCheck().

template<bool show_error>

bool osl::state::NumEffectState::isAlmostValidMove | ( | Move | move) |  | const

合法手かどうかを簡単に検査する．局面に依存するチェックのみ． ルール上指せない手である可能性がある場合は，isValidMove を用いる．

Pをtemplate引数にできると少しは速くなりそう 局面に依存する検査でも，玉の素抜きや王手を防いでいるか， 千日手，打歩詰かどうかは検査しない．

Parameters

  showError(template) | - falseを返す時には何か表示する.
  move | - 手

Definition at line 813 of file numEffectState.cc.

References osl::Move::from(), osl::Move::isNormal(), osl::Square::isPieceStand(), osl::Move::isValid(), osl::Move::player(), and osl::Move::to().

Referenced by makeUnmakeMove().

bool osl::state::NumEffectState::isAlmostValidMove | ( | Move | move,
|  | bool | show_error = `true`
| ) |  | const

Definition at line 837 of file numEffectState.cc.

bool osl::state::NumEffectState::isConsistent | ( | bool | showError = `true`) |  | const

Definition at line 655 of file numEffectState.cc.

References osl::alt(), osl::effect::NumSimpleEffectTable::effectedNumTable, osl::effect::NumSimpleEffectTable::effectSetAt(), osl::indexToPlayer(), osl::state::SimpleState::isConsistent(), osl::Piece::isOnBoard(), osl::Piece::isPromoted(), osl::checkmate::King8Info::make(), osl::effect_util::Pin::make(), osl::Piece::SIZE, and osl::checkmate::King8Info::uint64Value().

Referenced by osl::state::HistoryState::HistoryState(), and osl::state::operator==().

bool osl::state::NumEffectState::isConsistent | ( | const NumEffectState & | prev,
|  | Move | moved,
|  | bool | show_error = `true`
| ) |  | const

局面更新に関する一貫性をテスト

Definition at line 724 of file numEffectState.cc.

References osl::BLACK, effectedChanged(), effectedMask(), effectSetAt(), osl::indexToPlayer(), osl::state::SimpleState::pieceOf(), piecesOnBoard(), osl::Piece::SIZE, osl::Piece::square(), osl::Move::to(), and osl::WHITE.

bool osl::state::NumEffectState::isOnBoardNum | ( | int | num) |  | const
| inline

Definition at line 147 of file numEffectState.h.

References osl::BLACK, piecesOnBoard(), and osl::WHITE.

const osl::checkmate::King8Info osl::state::NumEffectState::king8Info | ( | Player | king) |  | const

Definition at line 34 of file numEffectState.cc.

Square osl::state::NumEffectState::kingMobilityAbs | ( | Player | p,
|  | Direction | d
| ) |  | const
| inline

Definition at line 160 of file numEffectState.h.

References king_mobility, and osl::Square::makeDirect().

Referenced by kingMobilityOfPlayer().

Square osl::state::NumEffectState::kingMobilityOfPlayer | ( | Player | p,
|  | Direction | d
| ) |  | const
| inline

玉がd方向にどこまで動けるかを返す

Parameters

  p | 注目する玉のプレイヤ
  d | piece からみた向き

Definition at line 169 of file numEffectState.h.

References osl::BLACK, osl::inverse(), and kingMobilityAbs().

template<Ptype PTYPE>

const mask_t osl::state::NumEffectState::longEffectAt | ( | Square | target) |  | const
| inline

Definition at line 275 of file numEffectState.h.

References effectSetAt().

Referenced by longEffectAt().

template<Ptype PTYPE>

const mask_t osl::state::NumEffectState::longEffectAt | ( | Square | target,
|  | Player | owner
| ) |  | const
| inline

Definition at line 279 of file numEffectState.h.

References piecesOnBoard(), and target.

const mask_t osl::state::NumEffectState::longEffectAt | ( | Square | target) |  | const
| inline

Definition at line 283 of file numEffectState.h.

References effectSetAt().

const mask_t osl::state::NumEffectState::longEffectAt | ( | Square | target,
|  | Player | owner
| ) |  | const
| inline

Definition at line 287 of file numEffectState.h.

References longEffectAt(), and piecesOnBoard().

template<Ptype PTYPE>

bool osl::state::NumEffectState::longEffectChanged | ( | ) |  | const
| inline

Definition at line 132 of file numEffectState.h.

References changedPieces().

const EffectedNumTable& osl::state::NumEffectState::longEffectNumTable | ( | ) |  | const
| inline

Definition at line 101 of file numEffectState.h.

References osl::effect::NumSimpleEffectTable::effectedNumTable, and effects.

Referenced by makePinOpenDir(), pinAttacker(), and recalcPinOpen().

template<osl::Player P>

template void osl::NumEffectState::makeKing8Info< WHITE > | ( | ) |  |
| private

Definition at line 40 of file numEffectState.cc.

References king8infos.

void osl::state::NumEffectState::makeMove | ( | Move | move) |  |

Definition at line 193 of file numEffectState.cc.

References osl::captured(), osl::Piece::EMPTY(), osl::Move::from(), osl::Move::isPass(), osl::Square::isPieceStand(), osl::Move::player(), osl::Move::promoteMask(), osl::Move::ptype(), and osl::Move::to().

Referenced by main().

void osl::state::NumEffectState::makeMovePass | ( | ) |  |
| inline

Definition at line 644 of file numEffectState.h.

References osl::state::SimpleState::changeTurn(), osl::effect::NumSimpleEffectTable::clearChangedEffects(), osl::effect::NumSimpleEffectTable::clearEffectedChanged(), and effects.

osl::container::PieceMask osl::state::NumEffectState::makePinOpen | ( | osl::Square | target,
|  | osl::Player | defense
| ) |  |
| private

Definition at line 874 of file numEffectState.cc.

References osl::alt(), osl::Square::isPieceStand(), and target.

Referenced by NumEffectState().

void osl::state::NumEffectState::makePinOpen | ( | osl::Player | defense) |  |
| private

Definition at line 891 of file numEffectState.cc.

template<Direction DIR>

void osl::state::NumEffectState::makePinOpenDir | ( | Square | target,
|  | PieceMask & | pins,
|  | PieceMask const & | onBoard,
|  | Player | defense
| ) |  |
| inlineprivate

Definition at line 918 of file numEffectState.h.

References osl::DirectionTraits< Dir >::blackOffset(), osl::Piece::isEdgeNum(), osl::Piece::isEmptyNum(), osl::Piece::isPieceNum(), king_mobility, longEffectNumTable(), osl::state::SimpleState::pieceAt(), and osl::Square::uintValue().

template<class Function >

void osl::state::NumEffectState::makeUnmakeMove | ( | Move | move,
|  | Function & | f
| ) |  |
| inline

Definition at line 659 of file numEffectState.h.

References osl::BLACK, and osl::Move::player().

template<Player P, class Function >

void osl::state::NumEffectState::makeUnmakeMove | ( | Player2Type< P > | player,
|  | Move | move,
|  | Function & | f
| ) |  |
| inline

Definition at line 667 of file numEffectState.h.

References osl::captured(), doUndoCaptureMove(), doUndoDropMove(), doUndoSimpleMove(), osl::Piece::EMPTY(), osl::Move::from(), isAlmostValidMove(), osl::Move::isPass(), osl::Square::isPieceStand(), osl::Move::isValid(), makeUnmakePass(), osl::state::SimpleState::pieceAt(), osl::Move::player(), osl::Move::promoteMask(), osl::Move::ptype(), osl::Move::to(), and osl::state::SimpleState::turn().

template<class Function >

void osl::state::NumEffectState::makeUnmakePass | ( | Function & | f) |  |
| inline

Definition at line 652 of file numEffectState.h.

References osl::state::SimpleState::changeTurn(), and osl::Square::STAND().

Referenced by makeUnmakeMove().

Square osl::state::NumEffectState::mobilityOf | ( | Direction | d,
|  | int | num
| ) |  | const
| inline

Definition at line 152 of file numEffectState.h.

References effects, osl::mobility::MobilityTable::get(), and osl::effect::NumSimpleEffectTable::mobilityTable.

Referenced by mobilityOf().

Square osl::state::NumEffectState::mobilityOf | ( | Direction | d,
|  | Piece | p
| ) |  | const
| inline

Definition at line 156 of file numEffectState.h.

References mobilityOf(), and osl::Piece::number().

const PieceMask& osl::state::NumEffectState::piecesOnBoard | ( | Player | p) |  | const
| inline

Definition at line 65 of file numEffectState.h.

References pieces_onboard.

Referenced by allEffectAt(), checkShadow(), osl::eval::ml::King25Effect::countEffectAndPieces(), osl::eval::ml::King25EffectBoth::countEffectAndPiecesBoth(), findAttackNotBy(), findCheapAttack(), findCheapAttackNotBy(), forEachEffect(), forEachEffectNotBy(), forEachOnBoard(), forEachOnBoardPtypeStrict(), hasEffectAt(), hasEffectByNotPinned(), hasEffectByNotPinnedAndKing(), hasEffectInDirection(), hasEffectNotBy(), isConsistent(), isOnBoardNum(), longEffectAt(), pin(), and recalcPinOpen().

const PieceMask osl::state::NumEffectState::pin | ( | Player | king) |  | const
| inline

Definition at line 67 of file numEffectState.h.

References piecesOnBoard(), and pin_or_open.

template<Player P>

Piece osl::state::NumEffectState::pinAttacker | ( | Piece | pinned) |  | const
| inline

Pのpinされた駒から，そのpinの原因となっている長い利きを持つ駒を得る．

Definition at line 217 of file numEffectState.h.

References osl::BLACK, osl::inverseUnsafe(), longEffectNumTable(), osl::Piece::number(), osl::Piece::owner(), osl::state::SimpleState::pieceOf(), and pinOrOpen().

Piece osl::state::NumEffectState::pinAttacker | ( | Piece | pinned) |  | const
| inline

Definition at line 225 of file numEffectState.h.

References osl::BLACK, and osl::Piece::owner().

template<Player P>

bool osl::state::NumEffectState::pinnedCanMoveTo | ( | Piece | p,
|  | Square | to
| ) |  | const
| inline

pinされた駒pがtoに動けるか? pinに関係がなければtoへ動けるという前提

Definition at line 199 of file numEffectState.h.

References osl::Board_Table, osl::BoardTable::getShort8Unsafe(), osl::Piece::owner(), osl::primDir(), osl::primDirUnsafe(), and osl::Piece::square().

bool osl::state::NumEffectState::pinnedCanMoveTo | ( | Piece | p,
|  | Square | to
| ) |  | const
| inline

Definition at line 206 of file numEffectState.h.

References osl::BLACK, and osl::Piece::owner().

template<Player P>

Direction osl::state::NumEffectState::pinnedDir | ( | Piece | p) |  | const
| inline

pinされた駒がPのKingから見てどの方向か? Pから見たdirectionを返す

Definition at line 180 of file numEffectState.h.

References osl::Board_Table, osl::BoardTable::getShort8(), osl::Piece::number(), osl::Piece::owner(), pinOrOpen(), and osl::Piece::square().

Direction osl::state::NumEffectState::pinnedDir | ( | Piece | p) |  | const
| inline

Definition at line 187 of file numEffectState.h.

References osl::BLACK, and osl::Piece::owner().

PieceMask osl::state::NumEffectState::pinOrOpen | ( | Player | king) |  | const
| inline

Definition at line 76 of file numEffectState.h.

References pin_or_open.

Referenced by hasEffectByNotPinned(), hasEffectByNotPinnedAndKing(), pinAttacker(), and pinnedDir().

template<osl::Player P>

template void osl::NumEffectState::prologueCapture | ( | Player2Type< P > | ,
|  | Square | from,
|  | Square | to,
|  | Piece | target,
|  | int | promoteMask,
|  | Piece & | oldPiece,
|  | PtypeO & | oldPtypeO,
|  | PtypeO & | capturePtypeO,
|  | PtypeO & | new_ptypeo,
|  | int & | num0,
|  | int & | num1,
|  | int & | num1Index,
|  | mask_t & | num1Mask,
|  | CArray< PieceMask, 2 > & | pin_or_open_backup,
|  | KingMobility & | king_mobility_backup,
|  | PieceMask & | promoted_backup,
|  | CArray< PieceMask, 2 > & | effected_mask_backup,
|  | CArray< PieceMask, 2 > & | effected_changed_mask_backup,
|  | CArray< uint64_t, 2 > & | king8infos_backup,
|  | MobilityTable & | mobility_backup
| ) |  |
| private

Definition at line 523 of file numEffectState.cc.

References osl::alt(), osl::BLACK, osl::container::Board_Mask_Table3x3, osl::Piece::captured(), osl::Piece::EMPTY(), osl::getPtype(), osl::KING, osl::container::BoardMaskTable3x3::mask(), osl::newPtypeO(), osl::Piece::number(), osl::Piece::promoteWithMask(), osl::PTYPE_BASIC_MIN, osl::Piece::ptypeO(), osl::UL, osl::unpromote(), and osl::WHITE.

template<osl::Player P>

template void osl::NumEffectState::prologueDrop | ( | Player2Type< P > | ,
|  | Square | to,
|  | Ptype | ptype,
|  | Piece & | oldPiece,
|  | int & | num,
|  | PtypeO & | ptypeO,
|  | int & | numIndex,
|  | mask_t & | numMask,
|  | CArray< PieceMask, 2 > & | pin_or_open_backup,
|  | KingMobility & | king_mobility_backup,
|  | CArray< PieceMask, 2 > & | effected_mask_backup,
|  | CArray< PieceMask, 2 > & | effected_changed_mask_backup,
|  | CArray< uint64_t, 2 > & | king8infos_backup,
|  | MobilityTable & | mobility_backup
| ) |  |
| private

Definition at line 423 of file numEffectState.cc.

References osl::alt(), osl::BLACK, osl::container::Board_Mask_Table3x3, osl::PtypeTable::getMaskLow(), osl::container::BoardMaskTable3x3::mask(), osl::PTYPE_BASIC_MIN, osl::Ptype_Table, osl::Piece::ptypeO(), osl::Square::STAND(), osl::UL, and osl::WHITE.

template<osl::Player P>

template void osl::NumEffectState::prologueSimple | ( | Player2Type< P > | ,
|  | Square | from,
|  | Square | to,
|  | int | promoteMask,
|  | Piece & | oldPiece,
|  | int & | num,
|  | PtypeO & | oldPtypeO,
|  | PtypeO & | new_ptypeo,
|  | CArray< PieceMask, 2 > & | pin_or_open_backup,
|  | KingMobility & | king_mobility_backup,
|  | PieceMask & | promoted_backup,
|  | CArray< PieceMask, 2 > & | effected_mask_backup,
|  | CArray< PieceMask, 2 > & | effected_changed_mask_backup,
|  | CArray< uint64_t, 2 > & | king8infos_backup,
|  | MobilityTable & | mobility_backup
| ) |  |
| private

Definition at line 313 of file numEffectState.cc.

References osl::alt(), osl::BLACK, osl::container::Board_Mask_Table3x3, osl::Piece::EMPTY(), osl::KING, osl::container::BoardMaskTable3x3::mask(), osl::newPtypeO(), osl::Piece::number(), osl::Piece::promoteWithMask(), osl::Piece::ptypeO(), osl::UL, and osl::WHITE.

const PieceMask osl::state::NumEffectState::promotedPieces | ( | ) |  | const
| inline

Definition at line 66 of file numEffectState.h.

References promoted.

void osl::state::NumEffectState::recalcPinOpen | ( | Square | changed,
|  | Direction & | lastDir,
|  | Player | defense
| ) |  |
| inlineprivate

Definition at line 933 of file numEffectState.h.

References osl::alt(), osl::BLACK, osl::Board_Table, osl::BoardTable::getLongDirection(), osl::BoardTable::getOffsetForBlack(), osl::Piece::isEdgeNum(), osl::Piece::isEmptyNum(), osl::isLong(), osl::Piece::isPieceNum(), osl::Square::isPieceStand(), king_mobility, osl::state::SimpleState::kingSquare(), longEffectNumTable(), osl::longToShort(), osl::Square::makeDirect(), osl::Piece::number(), osl::state::SimpleState::pieceAt(), piecesOnBoard(), pin_or_open, target, osl::Square::uintValue(), and osl::UL.

const osl::Piece osl::state::NumEffectState::selectCheapPiece | ( | PieceMask | effect) |  | const

利きの中から安そうな駒を選ぶ

Definition at line 90 of file numEffectState.cc.

References osl::Piece::EMPTY(), osl::KING, osl::LANCE, osl::eval::min(), and osl::PAWN.

Referenced by findCheapAttack(), and findCheapAttackNotBy().

void osl::state::NumEffectState::showEffect | ( | std::ostream & | os) |  | const

Definition at line 848 of file numEffectState.cc.

References osl::BLACK, osl::PieceTable::getPtypeOf(), osl::Piece_Table, osl::record::csa::show(), osl::Piece::SIZE, and osl::WHITE.

bool osl::state::NumEffectState::wasCheckEvasion | ( | Move | last_move) |  | const

Definition at line 167 of file numEffectState.cc.

References osl::alt(), osl::Board_Table, osl::Move::capturePtypeO(), osl::Move::from(), osl::BoardTable::getShort8Unsafe(), osl::BoardTable::isBetweenSafe(), osl::Move::isCapture(), osl::Move::isDrop(), osl::Move::isNormal(), osl::KING, osl::KNIGHT, osl::Piece::number(), osl::Move::oldPtype(), osl::Piece::owner(), osl::primDir(), osl::primDirUnsafe(), osl::Move::ptype(), and osl::Move::to().

## Friends And Related Function Documentation

bool operator== | ( | const NumEffectState & | st1,
|  | const NumEffectState & | st2
| ) |  |
| friend

駒番に依存した局面（インスタンス）比較をする.

なお、駒番に非依存な局面比較をしたい場合は、osl::record::CompactBoardや osl::hash::HashKeyを用いる.

## Member Data Documentation

effect::NumSimpleEffectTable osl::state::NumEffectState::effects
| private

Definition at line 37 of file numEffectState.h.

Referenced by changedEffects(), changedPieces(), copyFrom(), effectedChanged(), effectedMask(), effectSetAt(), findLongAttackAt(), hasChangedEffects(), longEffectNumTable(), makeMovePass(), mobilityOf(), NumEffectState(), and osl::state::operator==().

CArray<uint64_t,2> osl::state::NumEffectState::king8infos
| private

Definition at line 43 of file numEffectState.h.

Referenced by copyFrom(), Iking8Info(), makeKing8Info(), and osl::state::operator==().

KingMobility osl::state::NumEffectState::king_mobility
| private

Definition at line 42 of file numEffectState.h.

Referenced by copyFrom(), kingMobilityAbs(), makePinOpenDir(), osl::state::operator==(), and recalcPinOpen().

CArray<PieceMask,2> osl::state::NumEffectState::pieces_onboard
| private

Definition at line 38 of file numEffectState.h.

Referenced by copyFrom(), hasEffectInDirection(), hasEffectNotBy(), NumEffectState(), osl::state::operator==(), and piecesOnBoard().

CArray<PieceMask,2> osl::state::NumEffectState::pin_or_open
| private

Definition at line 41 of file numEffectState.h.

Referenced by checkShadow(), copyFrom(), osl::state::operator==(), pin(), pinOrOpen(), and recalcPinOpen().

PieceMask osl::state::NumEffectState::promoted
| private

成駒一覧

Definition at line 40 of file numEffectState.h.

Referenced by copyFrom(), findAttackAtStrict(), forEachOnBoardPtypeStrict(), hasEffectByPtypeStrict(), NumEffectState(), osl::state::operator==(), and promotedPieces().

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

- numEffectState.h
- numEffectState.tcc
- numEffectState.cc