osl::SimpleState Class Reference

`#include <simpleState.h>`

Inheritance diagram for osl::SimpleState:

## Public Member Functions

| SimpleState ()
| SimpleState (Handicap h)
virtual | ~SimpleState ()
void | init ()
| 盤面が空の状態に初期化
void | init (Handicap h)
| ハンディに応じた初期状態に初期化
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番目の駒を帰す.
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)
void | setPawn (Player pl, Square sq)
| (internal)
bool | isPawnMaskSet (Player player, int x) const
template<Player P>
bool | isPawnMaskSet (int x) const
bool | canDropPawnTo (Player player, int x) const
| xの筋に歩を打てる
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
| 持駒の枚数を数える
template<Ptype Type>
int | countPiecesOnStand (Player pl) const
| 後方互換
bool | hasPieceOnStand (Player player, Ptype ptype) const
template<Ptype T>
bool | hasPieceOnStand (Player P) const
Piece | nextPiece (Square cur, Offset diff) const
| diff方向にあるPiece を求める.
void | setTurn (Player player)
Player | turn () const
void | changeTurn ()
| 手番を変更する
bool | isConsistent (bool show_error=true) const
template<bool show_error>
bool | isAlmostValidMove (Move move) const
| エラー表示をするかどうかをtemplateパラメータにした高速化版
bool | isAlmostValidMove (Move move, bool show_error=true) const
| 合法手かどうかを簡単に検査する．局面に依存するチェックのみ． ルール上指せない手である可能性がある場合は，isValidMove を用いる．
bool | isValidMove (Move move, bool show_error=true) const
| 合法手かどうかを検査する． isValidMoveByRule, isAlmostValidMove をおこなう． 玉の素抜きや王手を防いでいるか， 千日手，打歩詰かどうかは検査しない．
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 前などにデバッグに使う
const SimpleState | emulateCapture (Piece from, Player new_owner) const
| from で表現されたPieceをnew_ownerの持駒にした局面を作る.
const SimpleState | emulateHandPiece (Player from, Player to, Ptype ptype) const
| from からto に ptypeの持駒を一枚渡した局面を作る.
const SimpleState | rotate180 () const
const SimpleState | flipHorizontal () const

## Static Public Member Functions

template<Ptype PTYPE>
static int | nthLimit ()
static bool | isValidMoveByRule (Move move, bool show_error)
| 盤面以外の部分の反則のチェック

## Static Public Attributes

static const bool | hasPawnMask =true

## Protected Member Functions

PieceMask & | standMask (Player p)
template<bool show_error>
bool | isAlmostValidDrop (Move move) const
template<bool show_error>
bool | testValidityOtherThanEffect (Move move) const

## Protected Attributes

CArray< Piece, Square::SIZE > | board
CArray< Piece, Piece::SIZE > | pieces
| 全てのpieceが登録されている
CArray< PieceMask, 2 > | stand_mask
CArray< BitXmask, 2 > | pawnMask
CArray< CArray< char, PTYPE_SIZE-PTYPE_BASIC_MIN >, 2 > | stand_count
Player | player_to_move
| 手番
PieceMask | used_mask

## Private Types

typedef SimpleState | state_t

## Private Member Functions

int | countPiecesOnStandBit (Player pl, Ptype ptype) const

## Friends

std::ostream & | operator<< (std::ostream &os, const SimpleState &state)
bool | operator== (const SimpleState &st1, const SimpleState &st2)
| 盤上の駒のみを比較する（持ち駒は見ない）.

## Detailed Description

Definition at line 34 of file simpleState.h.

## Member Typedef Documentation

## state_t

typedef SimpleState osl::SimpleState::state_t

private

Definition at line 39 of file simpleState.h.

## Constructor & Destructor Documentation

## SimpleState() [1/2]

osl::SimpleState::SimpleState | ( |  | ) |

explicit

Definition at line 12 of file simpleState.cc.

References init().

Referenced by osl::NumEffectState::copyFrom(), flipHorizontal(), osl::NumEffectState::NumEffectState(), operator<<, operator==, and rotate180().

## SimpleState() [2/2]

osl::SimpleState::SimpleState | ( | Handicap | h | ) |

explicit

Definition at line 16 of file simpleState.cc.

References init().

## ~SimpleState()

osl::SimpleState::~SimpleState | ( |  | ) |

virtual

Definition at line 112 of file simpleState.cc.

## Member Function Documentation

## canDropPawnTo()

bool osl::SimpleState::canDropPawnTo | ( | Player | player,
|  | int | x ) const

inline

xの筋に歩を打てる

Definition at line 155 of file simpleState.h.

References hasPieceOnStand(), and isPawnMaskSet().

Referenced by osl::move_probability::LanceAttack::match(), osl::move_probability::PawnAttack::match(), and osl::move_probability::RookAttack::match().

## changeTurn()

void osl::SimpleState::changeTurn | ( |  | ) |

inline

手番を変更する

Definition at line 226 of file simpleState.h.

References osl::alt(), and player_to_move.

Referenced by osl::NumEffectState::doUndoCaptureMove(), osl::NumEffectState::doUndoDropMove(), osl::NumEffectState::doUndoSimpleMove(), osl::NumEffectState::makeMove(), osl::NumEffectState::makeMovePass(), and osl::NumEffectState::makeUnmakePass().

## clearPawn()

void osl::SimpleState::clearPawn | ( | Player | pl,
|  | Square | sq )

inline

(internal)

Definition at line 138 of file simpleState.h.

References pawnMask.

Referenced by osl::NumEffectState::doCaptureMove(), osl::NumEffectState::doSimpleMove(), osl::NumEffectState::doUndoCaptureMove(), osl::NumEffectState::doUndoDropMove(), and osl::NumEffectState::doUndoSimpleMove().

## countPiecesOnStand() [1/2]

template<Ptype Type>

int osl::SimpleState::countPiecesOnStand | ( | Player | pl | ) | const

inline

後方互換

Definition at line 188 of file simpleState.h.

References countPiecesOnStand().

## countPiecesOnStand() [2/2]

int osl::SimpleState::countPiecesOnStand | ( | Player | pl,
|  | Ptype | ptype ) const

inline

持駒の枚数を数える

Definition at line 182 of file simpleState.h.

References osl::isBasic(), osl::PTYPE_BASIC_MIN, and stand_count.

Referenced by osl::progress::ml::NewProgress::attack5x5Value(), osl::enter_king::EnterKing::canDeclareWin(), osl::enter_king::EnterKing::canDeclareWin(), osl::record::KisenUtils::convertMove(), countPiecesOnStand(), osl::eval::ml::NonPawnPieceStandCombination::eval(), osl::eval::ml::NonPawnPieceStandTurn::eval(), osl::eval::ml::PieceStand::eval(), osl::eval::ml::King25Effect3::evalOne(), osl::eval::ml::King25EffectCountCombination::evalOne(), osl::eval::ml::PawnDropBoth::evalWithUpdate(), osl::eval::ml::PieceStand::evalWithUpdate(), osl::eval::ml::PieceStandY::evalWithUpdate(), osl::eval::ml::NonPawnPieceStandTurn::evalWithUpdateBang(), hasPieceOnStand(), hasPieceOnStand(), isConsistent(), osl::progress::Effect5x3::makeProgressStand(), osl::move_probability::CapturePtype::match(), osl::move_probability::DropAfterOpposingPawn::match(), osl::move_probability::OpposingPawn::match(), osl::progress::ml::NewProgress::NewProgress(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::PieceStand::PieceStand(), osl::record::KanjiPrint::print(), osl::record::KisenWriter::save(), osl::record::myshogi::show(), osl::usi::show(), osl::move_probability::MoveInfo::standIndex(), osl::progress::ml::NewProgress::updateMain(), and osl::eval::ml::PieceStandY::updateResult().

## countPiecesOnStandBit()

int osl::SimpleState::countPiecesOnStandBit | ( | Player | pl,
|  | Ptype | ptype ) const

inline private

Definition at line 199 of file simpleState.h.

References osl::Ptype_Table, and standMask().

Referenced by initPawnMask(), and isConsistent().

## dump()

bool osl::SimpleState::dump | ( |  | ) | const

dump: 自分を cerr に表示する。abort 前などにデバッグに使う

Definition at line 450 of file simpleState.cc.

## emulateCapture()

const osl::SimpleState osl::SimpleState::emulateCapture | ( | Piece | from,
|  | Player | new_owner ) const

from で表現されたPieceをnew_ownerの持駒にした局面を作る.

Definition at line 460 of file simpleState.cc.

References initPawnMask(), osl::Piece::owner(), pieceOf(), osl::Piece::ptype(), setPiece(), setTurn(), osl::Piece::square(), osl::Square::STAND(), turn(), and osl::unpromote().

## emulateHandPiece()

const osl::SimpleState osl::SimpleState::emulateHandPiece | ( | Player | from,
|  | Player | to,
|  | Ptype | ptype ) const

from からto に ptypeの持駒を一枚渡した局面を作る.

Definition at line 480 of file simpleState.cc.

References osl::alt(), hasPieceOnStand(), initPawnMask(), osl::Piece::isOnBoard(), osl::Piece::owner(), pieceOf(), osl::Piece::ptype(), setPiece(), setTurn(), osl::Piece::square(), osl::Square::STAND(), turn(), and usedMask().

## flipHorizontal()

const osl::SimpleState osl::SimpleState::flipHorizontal | ( |  | ) | const

Definition at line 518 of file simpleState.cc.

References osl::Square::flipHorizontal(), initPawnMask(), osl::Piece::owner(), pieceOf(), osl::Piece::ptype(), setPiece(), setTurn(), SimpleState(), osl::Piece::square(), turn(), and usedMask().

## getPiecePtr()

const Piece * osl::SimpleState::getPiecePtr | ( | Square | sq | ) | const

inline

Definition at line 169 of file simpleState.h.

References board, and osl::Square::index().

Referenced by osl::eval::ml::PiecePair::adjust12(), and osl::eval::ml::PiecePair::sum12().

## hasPieceOnStand() [1/2]

template<Ptype T>

bool osl::SimpleState::hasPieceOnStand | ( | Player | P | ) | const

inline

Definition at line 195 of file simpleState.h.

References countPiecesOnStand().

## hasPieceOnStand() [2/2]

bool osl::SimpleState::hasPieceOnStand | ( | Player | player,
|  | Ptype | ptype ) const

inline

Definition at line 191 of file simpleState.h.

References countPiecesOnStand().

Referenced by osl::checkmate::ProofPiecesUtil::addMonopolizedPieces(), osl::eval::ml::AttackMajorsInBase::addOne(), osl::move_probability::MoveInfo::adhocAdjustBishopFork(), osl::rating::BadLance::basicMatch(), osl::eval::ml::KnightCheck::canCheck(), canDropPawnTo(), osl::rating::Threatmate::captureForKnightCheck(), osl::checkmate::ProofNumberTable::disproofAfterAllCheck(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), emulateHandPiece(), osl::eval::ml::BishopRookFork::eval(), osl::eval::ml::BishopStandFile5::eval(), osl::eval::ml::KnightFork::eval(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::NoPawnOnStand::eval(), osl::eval::ml::PawnDropBoth::eval(), osl::eval::ml::PieceStandCombinationBoth::eval(), osl::eval::ml::SilverFork::eval(), osl::eval::ml::BishopRookFork::evalOne(), osl::eval::ml::King25Effect3::evalOne(), osl::eval::ml::KingMobility::evalOne(), osl::eval::ml::KnightFork::evalWithUpdate(), osl::eval::ml::PawnDropBoth::evalWithUpdate(), osl::rating::Threatmate::isCandidate(), osl::checkmate::ProofNumberTable::libertyAfterAllDrop(), osl::move_probability::CheckmateIfCapture::match(), osl::move_probability::CoverPawn::match(), osl::move_probability::DropAfterOpposingPawn::match(), osl::move_probability::OpposingPawn::match(), osl::eval::ml::OpenMidEndingEval::suggestMove(), and osl::progress::ml::NewProgress::updatePieceStand7().

## init() [1/2]

void osl::SimpleState::init | ( |  | ) |

盤面が空の状態に初期化

Definition at line 44 of file simpleState.cc.

References osl::BLACK, osl::Piece::EDGE(), osl::Piece::EMPTY(), osl::Square::nth(), pawnMask, osl::Piece_Table, pieces, player_to_move, setBoard(), osl::Piece::SIZE, osl::Square::SIZE, osl::Square::STAND(), stand_count, stand_mask, used_mask, and osl::WHITE.

Referenced by osl::book::MiniBoard::getState(), init(), osl::kakinoki::KakinokiFile::KakinokiFile(), osl::csa::CsaFileMinimal::load(), osl::usi::parse(), osl::usi::parseBoard(), osl::csa::CsaFileMinimal::parseLine(), osl::kakinoki::KakinokiFile::parseLine(), osl::record::CsaFile::read(), SimpleState(), SimpleState(), and osl::book::MiniBoardChar50::toSimpleState().

## init() [2/2]

void osl::SimpleState::init | ( | Handicap | h | ) |

ハンディに応じた初期状態に初期化

Definition at line 67 of file simpleState.cc.

References osl::BISHOP, osl::BLACK, osl::GOLD, osl::HIRATE, init(), initPawnMask(), osl::KING, osl::KNIGHT, osl::LANCE, osl::PAWN, osl::ROOK, setPiece(), osl::SILVER, and osl::WHITE.

## initPawnMask()

void osl::SimpleState::initPawnMask | ( |  | ) |

Definition at line 20 of file simpleState.cc.

References osl::BLACK, countPiecesOnStandBit(), isConsistent(), isPawnMaskSet(), osl::Square::isPieceStand(), osl::Piece::isPromotedNotKingGold(), osl::PieceStand::order, osl::Piece::owner(), pawnMask, pieceOf(), osl::PTYPE_BASIC_MIN, osl::Piece::square(), stand_count, osl::WHITE, and osl::Square::x().

Referenced by emulateCapture(), emulateHandPiece(), flipHorizontal(), init(), osl::usi::parse(), osl::csa::CsaFileMinimal::parseLine(), osl::kakinoki::KakinokiFile::parseLine(), rotate180(), and osl::book::MiniBoardChar50::toSimpleState().

## isAlmostValidDrop()

template<bool show_error>

bool osl::SimpleState::isAlmostValidDrop | ( | Move | move | ) | const

protected

Referenced by osl::NumEffectState::isAlmostValidMove(), and isAlmostValidMove().

## isAlmostValidMove() [1/2]

template<bool show_error>

bool osl::SimpleState::isAlmostValidMove | ( | Move | move | ) | const

エラー表示をするかどうかをtemplateパラメータにした高速化版

Definition at line 332 of file simpleState.cc.

References osl::Move::from(), isAlmostValidDrop(), osl::Square::isPieceStand(), osl::Move::isValid(), isValidMoveByRule(), pieceAt(), osl::Move::player(), osl::Ptype_Table, osl::Piece::ptypeO(), testValidityOtherThanEffect(), osl::Move::to(), turn(), and osl::Offset::zero().

Referenced by isAlmostValidMove(), and isValidMove().

## isAlmostValidMove() [2/2]

bool osl::SimpleState::isAlmostValidMove | ( | Move | move,
|  | bool | show_error = true ) const

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

局面に依存する検査でも，玉の素抜きや王手を防いでいるか， 千日手，打歩詰かどうかは検査しない．

Definition at line 318 of file simpleState.cc.

References isAlmostValidMove().

## isConsistent()

bool osl::SimpleState::isConsistent | ( | bool | show_error = true | ) | const

Definition at line 157 of file simpleState.cc.

References osl::BLACK, countPiecesOnStand(), countPiecesOnStandBit(), osl::Piece::isEmpty(), osl::Piece::isOnBoard(), isOnBoard(), osl::Square::isOnBoard(), osl::Piece::isPiece(), osl::Square::isPieceStand(), osl::Piece::isPromoted(), osl::Piece::isPromotedNotKingGold(), osl::KING, nth(), osl::Piece::number(), osl::PieceStand::order, osl::Piece::owner(), pawnMask, osl::Piece_Table, pieceAt(), pieceOf(), osl::playerToIndex(), osl::Piece::ptype(), osl::Piece::SIZE, osl::Piece::square(), osl::Square::squareForBlack(), osl::unpromote(), used_mask, usedMask(), osl::PieceTable::validNumber(), osl::WHITE, and osl::Square::y().

Referenced by initPawnMask(), osl::NumEffectState::isConsistent(), osl::kakinoki::KakinokiFile::KakinokiFile(), and osl::operator==().

## isEmptyBetween() [1/2]

bool osl::SimpleState::isEmptyBetween | ( | Square | from,
|  | Square | to,
|  | bool | noSpaceAtTo = false ) const

inline

Parameters

  from | - マスの位置
  to | - マスの位置 fromとtoがクイーンで利きがある位置関係にあるという前提 で，間が全部空白かをチェック

Definition at line 293 of file simpleState.h.

References osl::Board_Table, isEmptyBetween(), osl::Square::isOnBoard(), and osl::Offset::zero().

## isEmptyBetween() [2/2]

bool osl::SimpleState::isEmptyBetween | ( | Square | from,
|  | Square | to,
|  | Offset | offset,
|  | bool | pieceExistsAtTo = false ) const

inline

Parameters

  from | - マスの位置
  to | - マスの位置
  offset | - fromからtoへのshort offset fromとtoがクイーンで利きがある位置関係にあるという前提 で，間が全部空白かをチェック
  pieceExistsAtTo | - toに必ず駒がある (toが空白でも動く)

Definition at line 267 of file simpleState.h.

References osl::Board_Table, osl::Piece::isEmpty(), osl::Square::isOnBoard(), pieceAt(), and osl::Offset::zero().

Referenced by osl::effect_util::Neighboring8Direct::Table::findNearest(), osl::effect_util::Neighboring8Direct::Table::hasEffect(), osl::NumEffectState::hasEffectIf(), osl::move_probability::BreakThreatmate::isDefendingThreatmate(), isEmptyBetween(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), and osl::eval::ml::BishopRookFork::testCenter().

## isOffBoard()

bool osl::SimpleState::isOffBoard | ( | int | num | ) | const

inline

Definition at line 132 of file simpleState.h.

References osl::BLACK, standMask(), osl::PieceMask::test(), and osl::WHITE.

## isOnBoard()

bool osl::SimpleState::isOnBoard | ( | int | num | ) | const

inline

Definition at line 176 of file simpleState.h.

References osl::Piece::isOnBoard(), and pieceOf().

Referenced by osl::effect::NumSimpleEffectTable::init(), isConsistent(), osl::NumEffectState::NumEffectState(), and osl::progress::PtypeProgress::PtypeProgress().

## isPawnMaskSet() [1/2]

template<Player P>

bool osl::SimpleState::isPawnMaskSet | ( | int | x | ) | const

inline

Definition at line 152 of file simpleState.h.

References isPawnMaskSet().

Referenced by isPawnMaskSet().

## isPawnMaskSet() [2/2]

bool osl::SimpleState::isPawnMaskSet | ( | Player | player,
|  | int | x ) const

inline

Definition at line 146 of file simpleState.h.

References pawnMask.

Referenced by osl::rating::BadLance::basicMatch(), canDropPawnTo(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::PawnDropBoth::eval(), osl::eval::ml::RookPawn< Opening >::eval(), osl::eval::ml::SilverFeatures::evalOne(), osl::eval::ml::PawnDropBoth::evalWithUpdate(), initPawnMask(), and osl::eval::ml::PinPtypeAll::pawnAttack().

## isValidMove()

bool osl::SimpleState::isValidMove | ( | Move | move,
|  | bool | show_error = true ) const

合法手かどうかを検査する． isValidMoveByRule, isAlmostValidMove をおこなう． 玉の素抜きや王手を防いでいるか， 千日手，打歩詰かどうかは検査しない．

Definition at line 435 of file simpleState.cc.

References isAlmostValidMove(), osl::Move::isValid(), isValidMoveByRule(), osl::Move::player(), and turn().

Referenced by osl::record::KisenUtils::convertMove(), osl::record::CsaFile::makeInfo(), osl::usi::parse(), osl::csa::CsaFileMinimal::parseLine(), and osl::kakinoki::KakinokiFile::parseLine().

## isValidMoveByRule()

bool osl::SimpleState::isValidMoveByRule | ( | Move | move,
|  | bool | show_error )

static

盤面以外の部分の反則のチェック

Definition at line 372 of file simpleState.cc.

References osl::canPromote(), osl::Square::canPromote(), osl::Move::from(), osl::getPtype(), osl::isBasic(), osl::Move::isNormal(), osl::Square::isPieceStand(), osl::isPromoted(), osl::Move::isPromotion(), osl::Move::oldPtypeO(), osl::Move::player(), osl::Move::ptype(), osl::Ptype_Table, osl::Move::to(), turn(), osl::unpromote(), and osl::Offset::zero().

Referenced by osl::checkmate::OracleAdjust::attack(), osl::NumEffectState::isAlmostValidMove(), isAlmostValidMove(), and isValidMove().

## kingPiece() [1/2]

template<Player P>

const Piece osl::SimpleState::kingPiece | ( |  | ) | const

inline

Definition at line 83 of file simpleState.h.

References osl::KingTraits< T >::index, and pieceOf().

Referenced by osl::eval::ml::King8Effect::eval(), osl::eval::ml::PawnDropBoth::eval(), osl::eval::ml::King25EmptySquareNoEffect::evalOne(), osl::eval::ml::King25EmptySquareNoEffect::evalOne(), osl::eval::ml::NonPawnAttackedPtypePair::evalOne(), osl::eval::ml::PawnDropBoth::evalWithUpdate(), osl::GenerateEscapeKing::generate(), osl::checkmate::Dfpn::generateCheck(), osl::checkmate::Dfpn::generateEscape(), osl::eval::ml::BishopRookFork::isBishopForkSquare(), osl::eval::ml::BishopRookFork::isRookForkSquare(), kingPiece(), kingSquare(), osl::move_probability::LongRecapture::match(), osl::NumEffectState::safeCaptureNotByKing(), and osl::progress::ml::NewProgress::updateNonPawnAttackedPtypePairOne().

## kingPiece() [2/2]

const Piece osl::SimpleState::kingPiece | ( | Player | P | ) | const

inline

Definition at line 86 of file simpleState.h.

References osl::BLACK, osl::isValid(), and kingPiece().

## kingSquare() [1/2]

template<Player P>

Square osl::SimpleState::kingSquare | ( |  | ) | const

inline

Definition at line 94 of file simpleState.h.

References kingPiece(), and osl::Piece::square().

Referenced by osl::eval::ml::PiecePairKing::add(), osl::eval::ml::MajorCheckWithCapture::addOne(), osl::eval::ml::PiecePairKing::addSub(), osl::move_probability::MoveInfo::adhocAdjustBishopFork(), osl::eval::ml::RookMobilityAll::adjust(), osl::checkmate::Dfpn::analyze(), osl::progress::ml::NewProgress::attack5x5Value(), osl::checkmate::ProofNumberTable::attackEstimation(), osl::eval::ml::KnightCheck::canCheck(), osl::enter_king::EnterKing::canDeclareWin(), osl::enter_king::EnterKing::canDeclareWin(), osl::checkmate::CheckmateIfCapture::cannotCapture(), osl::rating::DefenseKing8::count(), osl::eval::ml::King25Effect::countEffectAndPieces(), osl::checkmate::ProofNumberTable::countLiberty(), osl::checkmate::King8Info::countMoveCandidate(), osl::eval::ml::OpenMidEndingEval::debugInfo(), osl::progress::Effect5x3::Effect5x3(), osl::progress::Effect5x3WithBonus::Effect5x3WithBonus(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::eval::ml::King8Effect::effectState(), osl::eval::ml::King8EffectAll::effectState(), osl::eval::ml::BishopEffectBase::eval(), osl::eval::ml::BishopHead::eval(), osl::eval::ml::GoldFeatures::eval(), osl::eval::ml::King25EffectY2::eval(), osl::eval::ml::King25EffectY::eval(), osl::eval::ml::King25EffectYAttack::eval(), osl::eval::ml::King25EffectYDefense::eval(), osl::eval::ml::King25Mobility::eval(), osl::eval::ml::KingPieceRelative::eval(), osl::eval::ml::KingPieceRelativeNoSupport::eval(), osl::eval::ml::KingXBlocked3::eval(), osl::eval::ml::KingXBlockedBase::eval(), osl::eval::ml::KingXBlockedYBase::eval(), osl::eval::ml::KingXBothBlocked::eval(), osl::eval::ml::KnightCheck::eval(), osl::eval::ml::LanceEffectPieceKingRelative::eval(), osl::eval::ml::NonPawnAttacked::eval(), osl::eval::ml::NumPiecesBetweenBishopAndKing::eval(), osl::eval::ml::PawnDropBoth::eval(), osl::eval::ml::PieceStandY::eval(), osl::eval::ml::Pin::eval(), osl::eval::ml::PtypeCount::eval(), osl::eval::ml::PtypeYY::eval(), osl::eval::ml::RookEffectBase::eval(), osl::eval::ml::RookPawnY::eval(), osl::eval::ml::SilverAdvance26::eval(), osl::eval::ml::SilverFeatures::eval(), osl::eval::ml::AnagumaEmpty::evalOne(), osl::eval::ml::BishopExchangeSilverKing::evalOne(), osl::eval::ml::CheckShadowPtype::evalOne(), osl::eval::ml::EnterKingDefense::evalOne(), osl::eval::ml::GoldAndSilverNearKing::evalOne(), osl::eval::ml::GoldFeatures::evalOne(), osl::eval::ml::King25BothSide::evalOne(), osl::eval::ml::King25Effect3::evalOne(), osl::eval::ml::King25EffectCountCombination::evalOne(), osl::eval::ml::King25EffectEach< Stage >::evalOne(), osl::eval::ml::King25EffectEachBoth::evalOne(), osl::eval::ml::King25EmptyAbs< Opening >::evalOne(), osl::eval::ml::King3Pieces::evalOne(), osl::eval::ml::KingMobility::evalOne(), osl::eval::ml::KingMobilitySum::evalOne(), osl::eval::ml::KingRookBishop::evalOne(), osl::eval::ml::PiecePairKing::evalOne(), osl::eval::ml::PinPtypeAll::evalOne(), osl::eval::ml::PromotedMinorPieces::evalOne(), osl::eval::ml::King25EffectEachBoth::evalWithUpdate(), osl::eval::ml::King25EmptyAbs< Opening >::evalWithUpdate(), osl::eval::ml::King25EmptySquareNoEffect::evalWithUpdate(), osl::eval::ml::King3Pieces::evalWithUpdate(), osl::eval::ml::KingPieceRelativeNoSupport::evalWithUpdate(), osl::eval::ml::PawnDropBoth::evalWithUpdate(), osl::eval::ml::PieceStandY::evalWithUpdate(), osl::eval::ml::PtypeYY::evalWithUpdate(), osl::eval::ml::KingXBlockedYBase::evalWithUpdateBang(), osl::eval::ml::NonPawnAttacked::evalWithUpdateBang(), osl::eval::ml::PiecePairKing::evalWithUpdateBang(), osl::eval::ml::PtypeCount::evalWithUpdateBang(), osl::eval::ml::King8EffectBase::evalWithUpdateCommon(), osl::eval::ml::King8EffectBase::evalWithUpdateCommon(), osl::NumEffectState::findCheckPiece(), osl::rating::AttackKing8Group::findMatch(), osl::checkmate::Dfpn::generateCheck(), osl::effect_util::Neighboring8Direct::Table::hasEffectOrAdditional(), osl::checkmate::Dfpn::hasEscapeMove(), osl::checkmate::King8Info::hasMoveCandidate(), osl::NumEffectState::inCheck(), osl::eval::ml::KingPieceRelative::index(), osl::rating::BigramAttack::index(), osl::rating::Karanari::index(), osl::NumEffectState::inUnblockableCheck(), osl::eval::ml::KingXBlockedBase::isBlocked(), osl::rating::Threatmate::isCandidate(), osl::NumEffectState::isConsistent(), osl::move_classifier::KingOpenMove< P >::isMember(), kingSquare(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::checkmate::King8Info::make(), osl::rating::RatingEnv::make(), osl::progress::Effect5x3WithBonus::makeEffectMask(), osl::NumEffectState::makeKing8Info(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::rating::RelativeKingX::makeOldX(), osl::rating::RelativeKingY::makeOldY(), osl::NumEffectState::makePinOpen(), osl::progress::Effect5x3::makeProgress(), osl::progress::Effect5x3d::makeProgress(), osl::checkmate::King8Info::makeWithPin(), osl::rating::RelativeKingX::makeX(), osl::rating::RelativeKingY::makeY(), osl::move_probability::BreakThreatmate::match(), osl::move_probability::CheckmateIfCapture::match(), osl::move_probability::DropAfterOpposingPawn::match(), osl::move_probability::EscapeThreatened::match(), osl::move_probability::King5x5Ptype::match(), osl::move_probability::KingBlockade::match(), osl::move_probability::KingRelativeX::match(), osl::move_probability::KingRelativeY::match(), osl::move_probability::LanceAttack::match(), osl::move_probability::LureDefender::match(), osl::move_probability::OpposingPawn::match(), osl::move_probability::PromotionBySacrifice::match(), osl::move_probability::SacrificeAttack::match(), osl::rating::AttackKing8::match(), osl::rating::Karanari::match(), osl::rating::DefenseKing8::matchDrop(), osl::rating::Karanari::matchGeneral(), osl::rating::DefenseKing8::matchMove(), osl::checkmate::King8Info::moveCandidateMask(), osl::NumEffectState::NumEffectState(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::eval::ml::King8EffectBase::MakeEffectStateDefense::operator()(), osl::eval::ml::King8EffectBase::MakeEffectStateSimple::operator()(), osl::NumEffectState::pinnedDir(), osl::progress::ml::NewProgress::progressOne(), osl::NumEffectState::prologueCapture(), osl::NumEffectState::prologueDrop(), osl::NumEffectState::prologueSimple(), osl::NumEffectState::recalcPinOpen(), osl::move_probability::CheckFeature::sign(), osl::eval::ml::PiecePairKing::sub(), osl::progress::Effect5x3::update(), osl::progress::Effect5x3d::update(), osl::progress::Effect5x3WithBonus::update(), osl::progress::ml::NewProgress::updateAttack5x5PiecesAndState(), osl::move_probability::PatternCommon::updateCacheOne(), osl::eval::ml::NonPawnAttacked::updateEffectChanged(), osl::eval::ml::OpenMidEndingEval::updateGoldSilverNearKing(), osl::progress::ml::NewProgress::updateMain(), osl::progress::ml::NewProgress::updatePieceKingRelativeBonus(), osl::eval::ml::OpenMidEndingEval::updateSub(), osl::progress::ml::NewProgress::updateSub(), and osl::NumEffectState::wasCheckEvasion().

## kingSquare() [2/2]

Square osl::SimpleState::kingSquare | ( | Player | player | ) | const

inline

Definition at line 97 of file simpleState.h.

References osl::BLACK, osl::isValid(), and kingSquare().

## nextPiece()

Piece osl::SimpleState::nextPiece | ( | Square | cur,
|  | Offset | diff ) const

inline

diff方向にあるPiece を求める.

Returns
  盤外ならPTYPE_EDGE

Definition at line 208 of file simpleState.h.

References osl::Piece::EMPTY(), pieceAt(), and osl::Offset::zero().

Referenced by osl::effect_util::AdditionalEffect::find(), osl::rating::PatternLong2::find(), and osl::eval::See::findAdditionalPieces().

## nth()

template<Ptype PTYPE>

const Piece osl::SimpleState::nth | ( | int | n | ) | const

inline

unpromote(PTYPE)のn番目の駒を帰す.

駒番号に依存するので順番は不定.

Definition at line 114 of file simpleState.h.

References nthLimit(), and pieceOf().

Referenced by osl::eval::ml::AttackMajorsInBase::eval(), osl::eval::ml::BishopExchangeSilverKing::eval(), osl::eval::ml::BishopExchangeSilverKing::evalOne(), and isConsistent().

## nthLimit()

template<Ptype PTYPE>

int osl::SimpleState::nthLimit | ( |  | ) |

inline static

Definition at line 105 of file simpleState.h.

Referenced by osl::eval::ml::AttackMajorsInBase::eval(), osl::eval::ml::BishopExchangeSilverKing::evalOne(), and nth().

## operator[]()

const Piece osl::SimpleState::operator[] | ( | Square | sq | ) | const

inline

Definition at line 168 of file simpleState.h.

References pieceAt().

## pieceAt()

const Piece osl::SimpleState::pieceAt | ( | Square | sq | ) | const

inline

Parameters

  sq | は isOnboardを満たす Square の12近傍(8近傍+桂馬の利き) ! isOnBoard(sq) の場合は PIECE_EDGE を返す

Definition at line 167 of file simpleState.h.

References board, and osl::Square::index().

Referenced by osl::move_probability::AddEffectLong::addOne(), osl::move_probability::BishopAttack::addOne(), osl::move_probability::PatternCommon::addOne(), osl::move_probability::MoveInfo::adhocAdjustSlider(), osl::progress::Effect5x3WithBonus::attackEffect3(), osl::eval::ml::KnightCheck::canCheck(), osl::move_classifier::PawnDropCheckmate< P >::canEscape(), osl::eval::ml::GoldFeatures::canMoveToSide(), osl::eval::ml::GoldFeatures::canRetreat(), osl::eval::ml::SilverFeatures::canRetreat(), osl::eval::ml::KnightAdvance::cantAdvance(), osl::eval::ml::PawnAdvanceUtil::cantAdvance(), osl::rating::Threatmate::captureForKnightCheck(), osl::eval::See::computeValue(), osl::record::KisenUtils::convertMove(), osl::rating::DefenseKing8::count(), osl::mobility::BishopMobility::countAll(), osl::mobility::LanceMobility::countAll(), osl::mobility::BishopMobility::countAllDir(), osl::eval::ml::NumPiecesBetweenBishopAndKing::countBetween(), osl::mobility::RookMobility::countHorizontalAll(), osl::mobility::countMobilityBoth(), osl::mobility::RookMobility::countVerticalAll(), osl::effect::NumSimpleEffectTable::doBlockAt(), osl::effect::NumSimpleEffectTable::doEffectLong(), osl::effect::NumSimpleEffectTable::doEffectShort(), osl::effect::EffectedNumTable::EffectedNumTable(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::eval::ml::King8Effect::effectState(), osl::eval::ml::King8EffectAll::effectState(), osl::eval::ml::BishopBishopPiece::eval(), osl::eval::ml::BishopHead::eval(), osl::eval::ml::BishopStandFile5::eval(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::LanceEffectPieceKingRelative::eval(), osl::eval::ml::PawnPtypeOPtypeO::eval(), osl::eval::ml::RookPromoteDefense::eval(), osl::eval::ml::RookRookPiece::eval(), osl::eval::ml::SilverAdvance26::eval(), osl::eval::ml::AnagumaEmpty::evalOne(), osl::eval::ml::BishopEffectBase::evalOne(), osl::eval::ml::EnterKingDefense::evalOne(), osl::eval::ml::GoldFeatures::evalOne(), osl::eval::ml::King25EmptyAbs< Opening >::evalOne(), osl::eval::ml::King25EmptySquareNoEffect::evalOne(), osl::eval::ml::King25EmptySquareNoEffect::evalOne(), osl::eval::ml::King3Pieces::evalOne(), osl::eval::ml::RookEffectBase::evalOne(), osl::eval::ml::SilverFeatures::evalOne(), osl::eval::ml::KingPieceRelativeNoSupport::evalWithUpdate(), osl::eval::ml::PawnPtypeOPtypeO::evalWithUpdate(), osl::eval::ml::PiecePair::evalWithUpdate(), osl::eval::ml::NonPawnAttacked::evalWithUpdateBang(), osl::eval::ml::NonPawnAttackedPtype::evalWithUpdateBang(), osl::eval::ml::PawnAdvanceAll::evalWithUpdateBang(), osl::eval::ml::PtypeYPawnY::evalWithUpdateBang(), osl::effect_util::SendOffSquare::find(), osl::eval::ml::BishopRookFork::findDropInLine(), osl::rating::AttackKing8Group::findMatch(), osl::rating::PatternGroup::findMatch(), osl::NumEffectState::forEachEffectOfPieceDir(), osl::NumEffectState::forEachEffectOfPieceLongDir(), osl::checkmate::Dfpn::generateCheck(), osl::checkmate::King8Info::hasEffectMask(), osl::effect_util::Neighboring8Direct::Table::hasEffectOrAdditional(), osl::eval::ml::King25EffectEach< Stage >::index(), osl::eval::ml::King25EffectEachBoth::index(), osl::NumEffectState::isAlmostValidMove(), isAlmostValidMove(), osl::eval::ml::KingXBlockedBase::isBlocked(), isConsistent(), isEmptyBetween(), osl::move_classifier::KingOpenMove< P >::isMember(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), osl::record::KisenPlusFile::load(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::NumEffectState::makePinOpenDir(), osl::NumEffectState::makeUnmakeMove(), osl::move_probability::CoverPawn::match(), osl::move_probability::LanceAttack::match(), osl::move_probability::OpposingPawn::match(), osl::rating::AttackKing8::match(), osl::rating::Pattern::match(), osl::eval::ml::SilverFork::matchGold(), osl::eval::ml::SilverFork::matchRook(), osl::mobility::MobilityTable::MobilityTable(), nextPiece(), osl::rating::PatternLong::nextPieceOrEnd(), osl::effect_util::SendOffSquare::onlyOneSupport(), osl::eval::ml::King8EffectBase::MakeEffectStateDefense::operator()(), osl::eval::ml::King8EffectBase::MakeEffectStateSimple::operator()(), osl::operator==(), operator[](), osl::eval::ml::PinPtypeAll::pawnAttack(), pieceOnBoard(), osl::eval::ml::PiecePair::pieceValueDouble(), osl::NumEffectState::prologueCapture(), osl::NumEffectState::prologueSimple(), osl::NumEffectState::recalcPinOpen(), osl::ki2::show(), osl::NumEffectState::showEffect(), osl::move_probability::PawnAttack::squareStatus(), osl::csa::strToMove(), osl::move_probability::ToEffect::supportAttack(), osl::eval::ml::BishopRookFork::testCenter(), and osl::move_probability::PatternCommon::updateCacheOne().

## pieceOf()

const Piece osl::SimpleState::pieceOf | ( | int | num | ) | const

inline

Definition at line 76 of file simpleState.h.

References pieces.

Referenced by osl::eval::ml::PiecePairKing::add(), osl::eval::ml::MajorCheckWithCapture::addOne(), osl::eval::ml::PiecePairKing::addSub(), osl::checkmate::OracleAdjust::attack(), osl::effect_util::AdditionalOrShadow::count(), osl::effect::NumSimpleEffectTable::doBlockAt(), osl::effect::EffectedNumTable::EffectedNumTable(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), emulateCapture(), emulateHandPiece(), osl::eval::ml::BishopBishopPiece::eval(), osl::eval::ml::BishopEffectBase::eval(), osl::eval::ml::BishopHead::eval(), osl::eval::ml::BishopMobilityAll::eval(), osl::eval::ml::BishopRookFork::eval(), osl::eval::ml::BishopSilverKnight::eval(), osl::eval::ml::GoldFeatures::eval(), osl::eval::ml::KingPieceRelative::eval(), osl::eval::ml::KingPieceRelativeNoSupport::eval(), osl::eval::ml::KnightAdvance::eval(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::LanceEffectPieceKingRelative::eval(), osl::eval::ml::LanceMobilityAll::eval(), osl::eval::ml::MajorY< Opening, MajorBasic >::eval(), osl::eval::ml::NonPawnAttacked::eval(), osl::eval::ml::NonPawnAttackedPtype::eval(), osl::eval::ml::NumPiecesBetweenBishopAndKing::eval(), osl::eval::ml::PawnAdvance::eval(), osl::eval::ml::PawnPtypeOPtypeO::eval(), osl::eval::ml::PieceEval::eval(), osl::eval::ml::PiecePair::eval(), osl::eval::ml::Pin::eval(), osl::eval::ml::PtypeX::eval(), osl::eval::ml::PtypeY::eval(), osl::eval::ml::PtypeYPawnY::eval(), osl::eval::ml::PtypeYY::eval(), osl::eval::ml::RookEffectBase::eval(), osl::eval::ml::RookMobilityAll::eval(), osl::eval::ml::RookPawn< Opening >::eval(), osl::eval::ml::RookPawnY::eval(), osl::eval::ml::RookPromoteDefense::eval(), osl::eval::ml::RookRook::eval(), osl::eval::ml::RookRookPiece::eval(), osl::eval::ml::RookSilverKnight::eval(), osl::eval::ml::SilverFeatures::eval(), osl::eval::ml::SilverFork::eval(), osl::eval::ml::SimplePin::eval(), osl::eval::ml::CheckShadowPtype::evalOne(), osl::eval::ml::King25Effect3::evalOne(), osl::eval::ml::KingRookBishop::evalOne(), osl::eval::ml::KnightFork::evalOne(), osl::eval::ml::MajorGoldSilverAttacked< Opening >::evalOne(), osl::eval::ml::NonPawnAttackedPtypePair::evalOne(), osl::eval::ml::PiecePairKing::evalOne(), osl::eval::ml::PinPtypeAll::evalOne(), osl::eval::ml::PromotedMinorPieces::evalOne(), osl::eval::ml::KingPieceRelativeNoSupport::evalWithUpdate(), osl::eval::ml::NonPawnAttackedPtype::evalWithUpdateBang(), osl::move_probability::BlockLong::findAll(), osl::NumEffectState::findAttackAt(), osl::NumEffectState::findAttackAtStrict(), osl::NumEffectState::findAttackNotBy(), osl::NumEffectState::findLongAttackAt(), osl::NumEffectState::findThreatenedPiece(), flipHorizontal(), osl::NumEffectState::forEachEffect(), osl::NumEffectState::forEachOnBoard(), osl::NumEffectState::forEachOnBoardPtypeStrict(), osl::effect_util::AdditionalEffect::hasEffect(), osl::NumEffectState::hasEffectAt(), osl::NumEffectState::hasEffectInDirection(), osl::hash::HashKey::HashKey(), osl::rating::ImmediateAddSupport::index(), osl::rating::PinAttack::index(), osl::effect::NumSimpleEffectTable::init(), initPawnMask(), osl::NumEffectState::isConsistent(), osl::NumEffectState::isConsistent(), isConsistent(), osl::move_probability::BreakThreatmate::isDefendingKing8(), isOnBoard(), kingPiece(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::move_probability::MoveFromOpposingSliders::longPtype(), osl::checkmate::King8Info::make(), osl::move_probability::CoverFork::match(), osl::move_probability::PromotionBySacrifice::match(), osl::rating::PinAttack::match(), osl::rating::RookDefense::match(), osl::book::MiniBoard::MiniBoard(), osl::book::MiniBoardChar50::MiniBoardChar50(), osl::mobility::MobilityTable::MobilityTable(), nth(), osl::NumEffectState::NumEffectState(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::NumEffectState::pinAttacker(), osl::NumEffectState::prologueDrop(), osl::progress::PtypeProgress::PtypeProgress(), rotate180(), osl::NumEffectState::selectCheapPiece(), osl::ki2::show(), osl::record::myshogi::show(), osl::eval::ml::PiecePairKing::sub(), osl::move_probability::BlockLong::updateCache(), osl::eval::ml::NonPawnAttackedPtype::updateChanged(), osl::eval::ml::NonPawnAttacked::updateEffectChanged(), osl::eval::ml::OpenMidEndingEval::updateGoldSilverNearKing(), osl::progress::ml::NewProgress::updateNonPawnAttackedPtypePairOne(), osl::progress::ml::NewProgress::updatePawnFacing(), and osl::progress::ml::NewProgress::updatePieceKingRelativeBonus().

## pieceOnBoard()

const Piece osl::SimpleState::pieceOnBoard | ( | Square | sq | ) | const

inline

Definition at line 170 of file simpleState.h.

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

Referenced by osl::checkmate::OracleAdjust::attack(), osl::rating::BadLance::basicMatch(), osl::enter_king::EnterKing::canDeclareWin(), osl::enter_king::EnterKing::canDeclareWin(), osl::checkmate::CheckmateIfCapture::cannotCapture(), osl::rating::Threatmate::captureForKnightCheck(), osl::record::KisenUtils::convertMove(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::eval::See::findEffectPiecesAfterMove(), osl::NumEffectState::findLongAttackAt(), osl::rating::AttackKing8Group::findMatch(), osl::rating::ImmediateAddSupport::index(), osl::rating::PinAttack::index(), osl::move_classifier::SafeMove< P >::isMember(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::NumEffectState::makeMove(), osl::move_probability::BreakThreatmate::match(), osl::move_probability::CoverPawn::match(), osl::move_probability::MoveFromOpposingSliders::match(), osl::move_probability::ToEffectLong::match(), osl::rating::AttackKing8::match(), osl::rating::ImmediateAddSupport::match(), osl::rating::PinAttack::match(), osl::rating::PatternLong::nextPieceOrEnd(), osl::operator<<(), osl::record::KanjiPrint::print(), osl::usi::show(), osl::kakinoki::strToMove(), osl::psn::strToMove(), and osl::NumEffectState::wasCheckEvasion().

## rotate180()

const osl::SimpleState osl::SimpleState::rotate180 | ( |  | ) | const

Definition at line 505 of file simpleState.cc.

References osl::alt(), initPawnMask(), osl::Piece::owner(), pieceOf(), osl::Piece::ptype(), osl::Square::rotate180Safe(), setPiece(), setTurn(), SimpleState(), osl::Piece::square(), turn(), and usedMask().

Referenced by osl::book::MiniBoardChar50::MiniBoardChar50(), and osl::book::MiniBoardChar50::toSimpleState().

## setBoard()

void osl::SimpleState::setBoard | ( | Square | sq,
|  | Piece | piece )

inline

Definition at line 119 of file simpleState.h.

References board, and osl::Square::index().

Referenced by osl::NumEffectState::epilogueCapture(), osl::NumEffectState::epilogueDrop(), osl::NumEffectState::epilogueSimple(), init(), osl::NumEffectState::prologueCapture(), osl::NumEffectState::prologueDrop(), osl::NumEffectState::prologueSimple(), and setPiece().

## setPawn()

void osl::SimpleState::setPawn | ( | Player | pl,
|  | Square | sq )

inline

(internal)

Definition at line 142 of file simpleState.h.

References pawnMask.

Referenced by osl::NumEffectState::doDropMove(), osl::NumEffectState::doUndoCaptureMove(), osl::NumEffectState::doUndoDropMove(), and osl::NumEffectState::doUndoSimpleMove().

## setPiece()

void osl::SimpleState::setPiece | ( | Player | player,
|  | Square | sq,
|  | Ptype | ptype )

Definition at line 114 of file simpleState.cc.

References osl::Square::isPieceStand(), osl::KING, osl::PAWN, pawnMask, osl::Piece_Table, osl::playerToIndex(), setBoard(), setPieceOf(), stand_mask, osl::unpromote(), and used_mask.

Referenced by emulateCapture(), emulateHandPiece(), flipHorizontal(), osl::book::MiniBoard::getState(), init(), osl::usi::parse(), osl::usi::parseBoard(), osl::csa::CsaFileMinimal::parseLine(), osl::kakinoki::KakinokiFile::parseLine(), rotate180(), and osl::book::MiniBoardChar50::toSimpleState().

## setPieceAll()

void osl::SimpleState::setPieceAll | ( | Player | player | ) |

Definition at line 139 of file simpleState.cc.

References osl::alt(), osl::Piece_Table, osl::playerToIndex(), setPieceOf(), osl::Square::STAND(), stand_mask, and used_mask.

Referenced by osl::csa::CsaFileMinimal::parseLine().

## setPieceOf()

void osl::SimpleState::setPieceOf | ( | int | num,
|  | Piece | p )

inline

Definition at line 79 of file simpleState.h.

References pieces.

Referenced by osl::NumEffectState::epilogueCapture(), osl::NumEffectState::epilogueDrop(), osl::NumEffectState::epilogueSimple(), osl::NumEffectState::prologueCapture(), osl::NumEffectState::prologueDrop(), osl::NumEffectState::prologueSimple(), setPiece(), and setPieceAll().

## setTurn()

void osl::SimpleState::setTurn | ( | Player | player | ) |

inline

Definition at line 217 of file simpleState.h.

References player_to_move.

Referenced by emulateCapture(), emulateHandPiece(), flipHorizontal(), osl::book::MiniBoard::getState(), osl::usi::parse(), osl::csa::CsaFileMinimal::parseLine(), rotate180(), and osl::book::MiniBoardChar50::toSimpleState().

## standMask() [1/2]

PieceMask & osl::SimpleState::standMask | ( | Player | p | ) |

inline protected

Definition at line 124 of file simpleState.h.

References stand_mask.

Referenced by countPiecesOnStandBit(), osl::NumEffectState::epilogueCapture(), osl::NumEffectState::epilogueDrop(), osl::eval::ml::BishopExchangeSilverKing::eval(), isOffBoard(), osl::NumEffectState::prologueCapture(), osl::NumEffectState::prologueDrop(), osl::progress::PtypeProgress::PtypeProgress(), and osl::NumEffectState::showEffect().

## standMask() [2/2]

const PieceMask & osl::SimpleState::standMask | ( | Player | p | ) | const

inline

Definition at line 128 of file simpleState.h.

References stand_mask.

## testValidityOtherThanEffect()

template<bool show_error>

bool osl::SimpleState::testValidityOtherThanEffect | ( | Move | move | ) | const

protected

Referenced by osl::NumEffectState::isAlmostValidMove(), and isAlmostValidMove().

## turn()

Player osl::SimpleState::turn | ( |  | ) | const

inline

Definition at line 220 of file simpleState.h.

References player_to_move.

Referenced by osl::rating::BradleyTerry::accumulate(), osl::move_probability::BishopAttack::addOne(), osl::rating::BradleyTerry::addSquare(), osl::move_probability::MoveInfo::adhocAdjustBishopFork(), osl::checkmate::Dfpn::analyze(), osl::checkmate::ProofNumberTable::attackEstimation(), osl::move_probability::KingBlockade::blockAll(), osl::rating::DefenseKing8::blocking(), osl::enter_king::EnterKing::canDeclareWin(), osl::enter_king::EnterKing::canDeclareWin(), osl::checkmate::CheckmateIfCapture::cannotCapture(), osl::rating::Threatmate::captureForKnightCheck(), osl::record::KisenUtils::convertMove(), osl::rating::CountEffect2::count(), osl::rating::DefenseKing8::count(), osl::move_probability::CoverFork::defending(), osl::NumEffectState::doCaptureMove(), osl::NumEffectState::doDropMove(), osl::NumEffectState::doSimpleMove(), osl::checkmate::CheckmateIfCapture::effectiveAttack(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), emulateCapture(), emulateHandPiece(), osl::rating::PatternBlock::find(), osl::rating::AttackKing8Group::findMatch(), osl::rating::BlockGroup::findMatch(), osl::rating::ChaseGroup::findMatch(), osl::rating::PatternBlockGroup::findMatch(), osl::checkmate::DualDfpn::findProof(), osl::checkmate::DualDfpn::findProof(), flipHorizontal(), osl::Move::fromMove16(), osl::GenerateEscapeKing::generate(), osl::move_generator::GenerateCapture::generate(), osl::move_generator::GenerateEscapeOfTurn::generate(), osl::NumEffectState::generateAllUnsafe(), osl::GenerateEscapeKing::generateCheap(), osl::NumEffectState::generateLegal(), osl::rating::FeatureSet::generateRating(), osl::checkmate::Dfpn::hasCheckmateMove(), osl::checkmate::Dfpn::hasEscapeMove(), osl::hash::HashKey::HashKey(), osl::NumEffectState::inCheck(), osl::eval::ml::MajorGoldSilverAttacked< Opening >::index(), osl::rating::BigramAttack::index(), osl::rating::ImmediateAddSupport::index(), osl::rating::Karanari::index(), osl::rating::PinAttack::index(), osl::NumEffectState::isAlmostValidMove(), isAlmostValidMove(), osl::rating::Threatmate::isCandidate(), osl::move_probability::BreakThreatmate::isDefendingKing8(), osl::checkmate::DualDfpn::isLosingState(), isValidMove(), isValidMoveByRule(), osl::rating::Threatmate::knight2Step(), osl::checkmate::DisproofPieces::leaf(), osl::checkmate::ProofPieces::leaf(), osl::checkmate::ProofNumberTable::libertyAfterAllDrop(), osl::checkmate::ProofNumberTable::libertyAfterAllDrop(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::record::KisenPlusFile::load(), osl::rating::RatingEnv::make(), osl::rating::RatingEnv::make(), osl::record::CsaFile::makeInfo(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::NumEffectState::makeMove(), osl::NumEffectState::makeUnmakeMove(), osl::move_probability::LureDefender::match(), osl::move_probability::PromotionBySacrifice::match(), osl::rating::AttackKing8::match(), osl::rating::Block::match(), osl::rating::Chase::match(), osl::rating::Karanari::match(), osl::rating::PinAttack::match(), osl::rating::DefenseKing8::matchDrop(), osl::rating::Karanari::matchGeneral(), osl::rating::DefenseKing8::matchMove(), osl::book::MiniBoard::MiniBoard(), osl::book::MiniBoardChar50::MiniBoardChar50(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::operator<<(), osl::operator==(), osl::kakinoki::KakinokiFile::parseLine(), osl::record::CsaFile::parseLine(), osl::record::KanjiPrint::print(), osl::RepetitionCounter::push(), rotate180(), osl::usi::show(), osl::csa::strToMove(), osl::kakinoki::strToMove(), osl::psn::strToMove(), osl::record::KanjiMove::strToMove(), osl::usi::strToMove(), osl::eval::ml::OpenMidEndingEval::suggestMove(), osl::move_probability::ToEffect::supportAttack(), osl::book::MiniBoardChar50::toSimpleState(), osl::checkmate::Dfpn::tryProofMain(), osl::eval::ml::OpenMidEndingEval::update(), osl::progress::Effect5x3::update(), osl::progress::ml::NewProgress::update(), osl::move_probability::PatternCommon::updateCacheOne(), osl::progress::ml::NewProgress::updateMain(), osl::progress::ml::NewProgress::updateSub(), and osl::NumEffectState::wasCheckEvasion().

## usedMask()

const PieceMask & osl::SimpleState::usedMask | ( |  | ) | const

inline

Definition at line 131 of file simpleState.h.

References used_mask.

Referenced by emulateHandPiece(), flipHorizontal(), osl::hash::HashKey::HashKey(), isConsistent(), osl::book::MiniBoard::MiniBoard(), and rotate180().

## Friends And Related Symbol Documentation

## operator<<

std::ostream & operator<< | ( | std::ostream & | os,
|  | const SimpleState & | state )

friend

References SimpleState().

## operator==

bool operator== | ( | const SimpleState & | st1,
|  | const SimpleState & | st2 )

friend

盤上の駒のみを比較する（持ち駒は見ない）.

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

References SimpleState().

## Member Data Documentation

## board

CArray<Piece,Square::SIZE> osl::SimpleState::board

protected

Definition at line 43 of file simpleState.h.

Referenced by osl::NumEffectState::copyFrom(), getPiecePtr(), pieceAt(), and setBoard().

## hasPawnMask

const bool osl::SimpleState::hasPawnMask =true

static

Definition at line 41 of file simpleState.h.

## pawnMask

CArray<BitXmask,2> osl::SimpleState::pawnMask

protected

Definition at line 57 of file simpleState.h.

Referenced by clearPawn(), osl::NumEffectState::copyFrom(), init(), initPawnMask(), isConsistent(), isPawnMaskSet(), osl::operator==(), setPawn(), and setPiece().

## pieces

CArray<Piece,Piece::SIZE> osl::SimpleState::pieces

protected

全てのpieceが登録されている

Definition at line 51 of file simpleState.h.

Referenced by osl::NumEffectState::copyFrom(), osl::NumEffectState::findAttackNotBy(), osl::NumEffectState::findCheapAttackNotBy(), osl::NumEffectState::findThreatenedPiece(), osl::NumEffectState::forEachEffect(), osl::NumEffectState::forEachEffectNotBy(), init(), pieceOf(), osl::NumEffectState::selectCheapPiece(), and setPieceOf().

## player_to_move

Player osl::SimpleState::player_to_move

protected

手番

Definition at line 61 of file simpleState.h.

Referenced by changeTurn(), osl::NumEffectState::copyFrom(), init(), setTurn(), and turn().

## stand_count

CArray<CArray<char,PTYPE_SIZE-PTYPE_BASIC_MIN>,2> osl::SimpleState::stand_count

protected

Definition at line 58 of file simpleState.h.

Referenced by osl::NumEffectState::copyFrom(), countPiecesOnStand(), osl::NumEffectState::epilogueCapture(), osl::NumEffectState::epilogueDrop(), init(), initPawnMask(), osl::NumEffectState::prologueCapture(), and osl::NumEffectState::prologueDrop().

## stand_mask

CArray<PieceMask,2> osl::SimpleState::stand_mask

protected

Definition at line 56 of file simpleState.h.

Referenced by osl::NumEffectState::copyFrom(), init(), setPiece(), setPieceAll(), standMask(), and standMask().

## used_mask

PieceMask osl::SimpleState::used_mask

protected

Definition at line 62 of file simpleState.h.

Referenced by osl::NumEffectState::copyFrom(), init(), isConsistent(), setPiece(), setPieceAll(), and usedMask().

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

- simpleState.h
- simpleState.cc