My Project
osl::Piece Class Reference

駒. More...

#include <basic_type.h>

Public Member Functions

int intValue () const
 Piece (Player owner, Ptype ptype, int num, Square square)
 Piece ()
Ptype ptype () const
PtypeO ptypeO () const
int number () const
const Square square () const
Pieceoperator+= (Offset offset)
void setSquare (Square square)
template<Player P>
bool isOnBoardByOwner () const
 piece がプレイヤーPの持ち物でかつボード上にある駒の場合は true.
bool isOnBoardByOwner (Player owner) const
 isOnBoardByOwner の通常関数のバージョン.
const Piece promote () const
const Piece unpromote () const
const Piece captured () const
 取られたpieceを作成.
const Piece promoteWithMask (int promote_mask) const
const Piece checkPromote (bool promotep) const
bool isPromoted () const
 promoteした駒かどうかをチェックする
bool isOnBoardNotPromoted () const
 promoteしていないOnBoardの駒であることのチェック Lance位しか使い道がない?
bool isPromotedNotKingGold () const
bool isEmpty () const
bool isEdge () const
template<Ptype T>
bool isPtype () const
bool isPlayerPtype (Player pl, Ptype ptype) const
 あるpieceがPlayer pの持ち物でPtype ptypeであるかどうかをチェックする. TはEMPTY, EDGEではない.
bool isPlayerBasicPtype (Player pl, Ptype ptype) const
 あるpieceがPlayer pの持ち物でBASIC typeがptypeであるかどうかをチェックする. TはEMPTY, EDGEではない.
bool isPiece () const
bool pieceIsBlack () const
 pieceであることが分かっている時に,更にBlackかどうかをチェックする.
Player owner () const
template<Player P>
bool canMoveOn () const
 Player Pの駒が,thisの上に移動できるか?
bool canMoveOn (Player pl) const
bool isOnBoard () const

Static Public Member Functions

static const Piece makeDirect (int value)
static const Piece EMPTY ()
static const Piece EDGE ()
static const Piece makeKing (Player owner, Square square)
 玉を作る
static bool isEmptyNum (int num)
static bool isEdgeNum (int num)
static bool isPieceNum (int num)

Static Public Attributes

static const int SIZE =40
static const int BitOffsetPtype =16
static const int BitOffsetPromote =BitOffsetPtype+3
static const int BitOffsetMovePromote =BitOffsetPromote+4

Private Member Functions

 Piece (int p)

Private Attributes

int piece

Detailed Description

駒.

駒はptypeo(-15 - 15), 番号(0-39), ポジション(0-0xff)からなる 上位16 bitでptypeo, 8bitで番号, 8bitでポジションとする. 空きマスは 黒,PTYPE_EMPTY, 番号 0x80, ポジション 0 盤外は 白,PTYPE_EDGE, 番号 0x40, ポジション 0

Definition at line 787 of file basic_type.h.

Constructor & Destructor Documentation

◆ Piece() [1/3]

osl::Piece::Piece ( int p)
inlineprivate

◆ Piece() [2/3]

osl::Piece::Piece ( Player owner,
Ptype ptype,
int num,
Square square )
inline

Definition at line 803 of file basic_type.h.

References BitOffsetPtype, owner(), piece, ptype(), and square().

◆ Piece() [3/3]

osl::Piece::Piece ( )
inline

Definition at line 809 of file basic_type.h.

References EMPTY(), and piece.

Referenced by captured(), checkPromote(), EDGE(), EMPTY(), makeDirect(), promote(), promoteWithMask(), and unpromote().

Member Function Documentation

◆ canMoveOn() [1/2]

template<Player P>
bool osl::Piece::canMoveOn ( ) const
inline

Player Pの駒が,thisの上に移動できるか?

PIECE_EMPTY 0x00008000 BLACK_PIECE 0x000XxxYY X>=2, YY>0 PIECE_EDGE 0xfff14000 WHITE_PIECE 0xfffXxxYY X>=2, YY>0

Returns
thisが相手の駒かEMPTYならtrue
Parameters
P手番

Definition at line 980 of file basic_type.h.

References canMoveOn().

Referenced by canMoveOn(), osl::eval::ml::SilverFeatures::canRetreat(), osl::eval::ml::KnightAdvance::cantAdvance(), osl::rating::Threatmate::captureForKnightCheck(), osl::mobility::countMobilityBoth(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::eval::ml::RookPromoteDefense::eval(), osl::checkmate::King8Info::hasEffectMask(), and osl::eval::ml::SilverFork::matchGold().

◆ canMoveOn() [2/2]

bool osl::Piece::canMoveOn ( Player pl) const
inline

Definition at line 981 of file basic_type.h.

References osl::BLACK, and piece.

◆ captured()

const Piece osl::Piece::captured ( ) const
inline

取られたpieceを作成.

unpromoteして,Squareは0に 相手の持ちものにする

Definition at line 879 of file basic_type.h.

References Piece(), Piece(), and piece.

Referenced by osl::NumEffectState::prologueCapture().

◆ checkPromote()

const Piece osl::Piece::checkPromote ( bool promotep) const
inline

Definition at line 891 of file basic_type.h.

References Piece(), Piece(), and piece.

◆ EDGE()

◆ EMPTY()

◆ intValue()

int osl::Piece::intValue ( ) const
inline

Definition at line 796 of file basic_type.h.

References piece.

Referenced by osl::Move::newAddCapture(), osl::Move::newCapture(), osl::operator<(), and osl::operator==().

◆ isEdge()

◆ isEdgeNum()

◆ isEmpty()

bool osl::Piece::isEmpty ( ) const
inline

Definition at line 913 of file basic_type.h.

References piece.

Referenced by osl::move_probability::AddEffectLong::addOne(), osl::move_probability::BishopAttack::addOne(), osl::rating::BadLance::basicMatch(), osl::eval::ml::KnightCheck::canCheck(), osl::rating::Threatmate::captureForKnightCheck(), osl::record::KisenUtils::convertMove(), osl::eval::ml::NumPiecesBetweenBishopAndKing::countBetween(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::eval::ml::King8Effect::effectState(), osl::eval::ml::King8EffectAll::effectState(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::AnagumaEmpty::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::SilverFeatures::evalOne(), osl::eval::ml::PtypeYPawnY::evalWithUpdateBang(), osl::eval::ml::BishopRookFork::findDropInLine(), osl::NumEffectState::forEachEffectOfPieceLongDir(), osl::checkmate::King8Info::hasEffectMask(), osl::effect_util::Neighboring8Direct::Table::hasEffectOrAdditional(), osl::eval::ml::King25EffectEach< Stage >::index(), osl::SimpleState::isConsistent(), osl::SimpleState::isEmptyBetween(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::move_probability::LanceAttack::match(), osl::rating::LongTarget2::match(), osl::eval::ml::SilverFork::matchGold(), osl::eval::ml::SilverFork::matchRook(), osl::eval::ml::King8EffectBase::MakeEffectStateSimple::operator()(), osl::eval::ml::PinPtypeAll::pawnAttack(), osl::csa::show(), osl::usi::show(), osl::eval::ml::BishopRookFork::testCenter(), and osl::move_probability::StateInfo::updatePinnedGenerals().

◆ isEmptyNum()

◆ isOnBoard()

bool osl::Piece::isOnBoard ( ) const
inline

Definition at line 985 of file basic_type.h.

References osl::Square::isPieceStand(), osl::isValid(), and square().

Referenced by osl::eval::ml::GoldFeatures::canRetreat(), osl::eval::ml::SilverFeatures::canRetreat(), osl::mobility::BishopMobility::countAll(), osl::mobility::LanceMobility::countAll(), osl::mobility::BishopMobility::countAllDir(), osl::eval::ml::NumPiecesBetweenBishopAndKing::countBetween(), osl::mobility::BishopMobility::countBoth(), osl::mobility::LanceMobility::countBoth(), osl::mobility::RookMobility::countHorizontalBoth(), osl::mobility::BishopMobility::countSafe(), osl::mobility::LanceMobility::countSafe(), osl::mobility::RookMobility::countVerticalBoth(), osl::effect::EffectedNumTable::EffectedNumTable(), osl::SimpleState::emulateHandPiece(), osl::eval::ml::AttackMajorsInBase::eval(), osl::eval::ml::BishopBishopPiece::eval(), osl::eval::ml::BishopEffectBase::eval(), osl::eval::ml::BishopMobilityAll::eval(), osl::eval::ml::BishopSilverKnight::eval(), osl::eval::ml::GoldFeatures::eval(), osl::eval::ml::KingPieceRelative::eval(), osl::eval::ml::KnightAdvance::eval(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::LanceEffectPieceKingRelative::eval(), osl::eval::ml::MajorY< Opening, MajorBasic >::eval(), osl::eval::ml::NumPiecesBetweenBishopAndKing::eval(), osl::eval::ml::PawnAdvance::eval(), osl::eval::ml::PawnPtypeOPtypeO::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::RookRookPiece::eval(), osl::eval::ml::RookSilverKnight::eval(), osl::eval::ml::SilverFeatures::eval(), osl::eval::ml::BishopExchangeSilverKing::evalOne(), osl::eval::ml::KingRookBishop::evalOne(), osl::eval::ml::MajorGoldSilverAttacked< Opening >::evalOne(), osl::eval::ml::PiecePair::index(), osl::eval::ml::RookRook::index(), osl::NumEffectState::isConsistent(), osl::SimpleState::isConsistent(), osl::SimpleState::isOnBoard(), osl::move_probability::StateInfo::makePinOfLongPieces(), osl::mobility::MobilityTable::MobilityTable(), osl::NumEffectState::NumEffectState(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::eval::ml::PiecePair::pieceValueDouble(), osl::record::myshogi::show(), osl::record::myshogi::show(), osl::move_probability::BlockLong::updateCache(), osl::eval::ml::OpenMidEndingEval::updateGoldSilverNearKing(), osl::progress::ml::NewProgress::updatePieceKingRelativeBonus(), and osl::eval::ml::PiecePair::value().

◆ isOnBoardByOwner() [1/2]

template<Player P>
bool osl::Piece::isOnBoardByOwner ( ) const
inline

piece がプレイヤーPの持ち物でかつボード上にある駒の場合は true.

敵の駒だったり,駒台の駒だったり,Piece::EMPTY(), PIECE_EDGEの場合は false

Parameters
P(template)- プレイヤー
piece-

Definition at line 852 of file basic_type.h.

References isOnBoardByOwner().

Referenced by osl::eval::ml::KnightFork::accumulate(), osl::progress::Effect5x3WithBonus::attackEffect3(), osl::eval::ml::KnightCheck::canCheck(), osl::enter_king::EnterKing::canDeclareWin(), osl::enter_king::EnterKing::canDeclareWin(), osl::move_classifier::PawnDropCheckmate< P >::canEscape(), osl::eval::ml::GoldFeatures::canMoveToSide(), osl::eval::ml::GoldFeatures::canRetreat(), osl::eval::ml::PawnAdvanceUtil::cantAdvance(), osl::rating::ImmediateAddSupport::Test::doAction(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::eval::ml::King8EffectAll::effectState(), osl::eval::ml::BishopRookFork::evalOne(), osl::eval::ml::KnightFork::evalOne(), osl::move_probability::StateInfo::finishUpdate(), osl::checkmate::King8Info::hasEffectMask(), osl::eval::ml::KingXBlockedBase::isBlocked(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), isOnBoardByOwner(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::move_probability::CoverPawn::match(), osl::move_probability::LanceAttack::match(), osl::eval::ml::SilverFork::matchGold(), osl::eval::ml::SilverFork::matchRook(), osl::effect_util::SendOffSquare::onlyOneSupport(), osl::eval::ml::King8EffectBase::MakeEffectStateDefense::operator()(), osl::ki2::show(), and osl::move_probability::StateInfo::updatePinnedGenerals().

◆ isOnBoardByOwner() [2/2]

bool osl::Piece::isOnBoardByOwner ( Player owner) const
inline

isOnBoardByOwner の通常関数のバージョン.

Definition at line 856 of file basic_type.h.

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

◆ isOnBoardNotPromoted()

bool osl::Piece::isOnBoardNotPromoted ( ) const
inline

promoteしていないOnBoardの駒であることのチェック Lance位しか使い道がない?

Definition at line 904 of file basic_type.h.

References piece.

Referenced by osl::eval::ml::BishopHead::eval(), osl::eval::ml::LanceMobilityAll::eval(), and osl::eval::ml::RookPromoteDefense::eval().

◆ isPiece()

◆ isPieceNum()

◆ isPlayerBasicPtype()

bool osl::Piece::isPlayerBasicPtype ( Player pl,
Ptype ptype ) const
inline

あるpieceがPlayer pの持ち物でBASIC typeがptypeであるかどうかをチェックする. TはEMPTY, EDGEではない.

Definition at line 945 of file basic_type.h.

References BitOffsetPtype, osl::canPromote(), osl::isBasic(), isPlayerPtype(), piece, osl::promote(), ptype(), osl::PTYPE_MAX, and osl::PTYPE_PIECE_MIN.

◆ isPlayerPtype()

bool osl::Piece::isPlayerPtype ( Player pl,
Ptype ptype ) const
inline

あるpieceがPlayer pの持ち物でPtype ptypeであるかどうかをチェックする. TはEMPTY, EDGEではない.

Definition at line 937 of file basic_type.h.

References BitOffsetPtype, piece, ptype(), osl::PTYPE_MAX, and osl::PTYPE_PIECE_MIN.

Referenced by osl::eval::ml::AttackMajorsInBase::addOne(), osl::eval::ml::PawnAdvanceAll::evalWithUpdateBang(), and isPlayerBasicPtype().

◆ isPromoted()

◆ isPromotedNotKingGold()

◆ isPtype()

template<Ptype T>
bool osl::Piece::isPtype ( ) const
inline

◆ makeDirect()

const Piece osl::Piece::makeDirect ( int value)
inlinestatic

Definition at line 795 of file basic_type.h.

References Piece(), and Piece().

◆ makeKing()

const osl::Piece osl::Piece::makeKing ( Player owner,
Square square )
static

玉を作る

Definition at line 231 of file basic_type.cc.

References osl::BLACK, osl::KingTraits< T >::index, osl::KING, number(), owner(), and Piece().

◆ number()

int osl::Piece::number ( ) const
inline

Definition at line 828 of file basic_type.h.

References piece.

Referenced by osl::move_probability::BlockLong::addPiece(), osl::eval::See::computeValue(), osl::mobility::BishopMobility::countAll(), osl::mobility::LanceMobility::countAll(), osl::mobility::BishopMobility::countAllDir(), osl::eval::ml::NumPiecesBetweenBishopAndKing::countBetween(), osl::mobility::RookMobility::countHorizontalAll(), osl::mobility::RookMobility::countVerticalAll(), osl::effect::NumSimpleEffectTable::doBlockAt(), osl::effect::NumSimpleEffectTable::doEffect(), osl::effect::NumSimpleEffectTable::doEffectLong(), osl::effect::NumSimpleEffectTable::doEffectShort(), osl::effect::EffectedNumTable::EffectedNumTable(), osl::eval::ml::BishopBishopPiece::eval(), osl::eval::ml::LanceEffectPieceKingRelative::eval(), osl::eval::ml::NonPawnAttackedPtype::eval(), osl::eval::ml::RookRookPiece::eval(), osl::eval::ml::NonPawnAttackedPtypePair::evalOne(), osl::eval::ml::KingPieceRelativeNoSupport::evalWithUpdate(), osl::eval::ml::NonPawnAttacked::evalWithUpdateBang(), osl::eval::See::findEffectPiecesAfterMove(), osl::NumEffectState::findLongAttackAt(), osl::NumEffectState::forEachEffectNotBy(), osl::checkmate::Dfpn::generateCheck(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiece(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtype(), osl::NumEffectState::hasEffectByPiece(), osl::NumEffectState::hasEffectNotBy(), osl::SimpleState::isConsistent(), osl::move_classifier::KingOpenMove< P >::isMember(), makeKing(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::move_probability::ToEffectLong::match(), osl::NumEffectState::mobilityOf(), osl::operator<<(), osl::NumEffectState::pinAttacker(), osl::NumEffectState::pinnedDir(), osl::NumEffectState::prologueCapture(), osl::NumEffectState::prologueSimple(), osl::NumEffectState::recalcPinOpen(), osl::csa::show(), osl::move_probability::ToEffect::supportAttack(), osl::move_probability::PatternCommon::updateCacheOne(), osl::eval::ml::NonPawnAttackedPtype::updateChanged(), osl::eval::ml::NonPawnAttacked::updateEffectChanged(), osl::progress::ml::NewProgress::updateNonPawnAttackedPtypePairOne(), and osl::NumEffectState::wasCheckEvasion().

◆ operator+=()

Piece & osl::Piece::operator+= ( Offset offset)
inline

Definition at line 836 of file basic_type.h.

References osl::Offset::intValue(), Piece(), and piece.

◆ owner()

Player osl::Piece::owner ( ) const
inline

Definition at line 963 of file basic_type.h.

References isPiece(), and piece.

Referenced by osl::move_probability::BishopAttack::addOne(), 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::See::computeValue(), osl::record::KisenUtils::convertMove(), osl::effect_util::AdditionalOrShadow::count(), osl::mobility::BishopMobility::countAll(), osl::mobility::LanceMobility::countAll(), osl::mobility::BishopMobility::countAllDir(), osl::eval::ml::NumPiecesBetweenBishopAndKing::countBetween(), osl::mobility::BishopMobility::countBoth(), osl::mobility::LanceMobility::countBoth(), osl::mobility::RookMobility::countHorizontalBoth(), osl::mobility::BishopMobility::countSafe(), osl::mobility::LanceMobility::countSafe(), osl::mobility::RookMobility::countVerticalBoth(), osl::effect::NumSimpleEffectTable::doBlockAt(), osl::effect::EffectedNumTable::EffectedNumTable(), osl::SimpleState::emulateCapture(), osl::SimpleState::emulateHandPiece(), osl::eval::ml::AttackMajorsInBase::eval(), osl::eval::ml::BishopBishopPiece::eval(), osl::eval::ml::BishopEffectBase::eval(), osl::eval::ml::BishopHead::eval(), osl::eval::ml::BishopMobilityAll::eval(), osl::eval::ml::BishopSilverKnight::eval(), osl::eval::ml::GoldFeatures::eval(), osl::eval::ml::KingPieceRelative::eval(), osl::eval::ml::KnightAdvance::eval(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::LanceEffectPieceKingRelative::eval(), osl::eval::ml::MajorY< Opening, MajorBasic >::eval(), osl::eval::ml::NumPiecesBetweenBishopAndKing::eval(), osl::eval::ml::PawnAdvance::eval(), osl::eval::ml::PawnPtypeOPtypeO::eval(), osl::eval::ml::PtypeX::eval(), osl::eval::ml::PtypeY::eval(), osl::eval::ml::PtypeYPawnY::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::SilverAdvance26::eval(), osl::eval::ml::SilverFeatures::eval(), osl::eval::ml::BishopExchangeSilverKing::evalOne(), osl::eval::ml::EnterKingDefense::evalOne(), osl::eval::ml::GoldFeatures::evalOne(), osl::eval::ml::MajorGoldSilverAttacked< Opening >::evalOne(), osl::eval::ml::King8EffectEmptySquare< false >::evalWithUpdate(), osl::eval::ml::KingPieceRelativeNoSupport::evalWithUpdate(), osl::eval::ml::NonPawnAttacked::evalWithUpdateBang(), osl::eval::ml::PtypeYPawnY::evalWithUpdateBang(), osl::effect_util::AdditionalEffect::find(), osl::eval::See::findAdditionalPieces(), osl::NumEffectState::findLongAttackAt(), osl::NumEffectState::findLongAttackAt(), osl::rating::AttackKing8Group::findMatch(), osl::rating::PatternGroup::findMatch(), osl::rating::PatternLongGroup2::findMatch(), osl::SimpleState::flipHorizontal(), osl::move_generator::Escape< Action >::generateEscape(), osl::effect_util::AdditionalEffect::hasEffect(), osl::NumEffectState::hasEffectNotBy(), osl::eval::ml::King25EffectEach< Stage >::index(), osl::eval::ml::KingPieceRelative::index(), osl::eval::ml::KingRookBishop::index(), osl::eval::ml::MajorGoldSilverAttacked< Opening >::index(), osl::eval::ml::MajorY< Opening, MajorBasic >::index(), osl::eval::ml::Pin::index(), osl::eval::ml::PtypeX::index(), osl::eval::ml::PtypeY::index(), osl::eval::ml::RookPawnY::index(), osl::eval::ml::NonPawnAttackedPtypePair::index1(), osl::eval::ml::NonPawnAttacked::indexK(), osl::eval::ml::PawnDropBoth::indexX(), osl::eval::ml::PawnDropBoth::indexY(), osl::eval::ml::RookPawnY::indexY(), osl::SimpleState::initPawnMask(), osl::SimpleState::isConsistent(), osl::move_classifier::SafeMove< P >::isMember(), isOnBoardByOwner(), makeKing(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::move_probability::AttackToOpposingSliders::match(), osl::rating::AttackKing8::match(), osl::rating::LongTarget2::match(), osl::rating::Pattern::match(), osl::rating::RookDefense::match(), osl::eval::ml::SilverFork::matchGold(), osl::eval::ml::SilverFork::matchRook(), osl::book::MiniBoard::MiniBoard(), osl::book::MiniBoardChar50::MiniBoardChar50(), osl::mobility::MobilityTable::MobilityTable(), osl::NumEffectState::NumEffectState(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::operator<<(), osl::book::OPiece::OPiece(), osl::book::OSquare::OSquare(), Piece(), osl::NumEffectState::pinAttacker(), osl::NumEffectState::pinnedCanMoveTo(), osl::NumEffectState::pinnedDir(), osl::SimpleState::rotate180(), osl::csa::show(), osl::record::myshogi::show(), osl::move_probability::PawnAttack::squareStatus(), osl::move_probability::BlockLong::updateCache(), osl::move_probability::PatternCommon::updateCacheOne(), osl::eval::ml::OpenMidEndingEval::updateGoldSilverNearKing(), osl::progress::ml::NewProgress::updatePieceKingRelativeBonus(), and osl::NumEffectState::wasCheckEvasion().

◆ pieceIsBlack()

bool osl::Piece::pieceIsBlack ( ) const
inline

pieceであることが分かっている時に,更にBlackかどうかをチェックする.

Definition at line 959 of file basic_type.h.

References isPiece(), and piece.

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

◆ promote()

const Piece osl::Piece::promote ( ) const
inline

Definition at line 865 of file basic_type.h.

References osl::canPromote(), Piece(), Piece(), piece, and ptype().

◆ promoteWithMask()

const Piece osl::Piece::promoteWithMask ( int promote_mask) const
inline

◆ ptype()

Ptype osl::Piece::ptype ( ) const
inline

Definition at line 821 of file basic_type.h.

References BitOffsetPtype, and piece.

Referenced by osl::eval::ml::KnightFork::accumulate(), osl::eval::ml::PiecePairKing::add(), osl::eval::ml::AttackMajorsInBase::addOne(), osl::eval::ml::MajorCheckWithCapture::addOne(), osl::move_probability::BishopAttack::addOne(), osl::eval::ml::PiecePairKing::addSub(), osl::move_probability::MoveInfo::adhocAdjustBishopFork(), osl::checkmate::OracleAdjust::attack(), osl::rating::DefenseKing8::blocking(), osl::enter_king::EnterKing::canDeclareWin(), osl::enter_king::EnterKing::canDeclareWin(), osl::record::KisenUtils::convertMove(), osl::mobility::BishopMobility::countAll(), osl::mobility::LanceMobility::countAll(), osl::mobility::BishopMobility::countAllDir(), osl::mobility::BishopMobility::countBoth(), osl::mobility::LanceMobility::countBoth(), osl::mobility::RookMobility::countHorizontalBoth(), osl::mobility::BishopMobility::countSafe(), osl::mobility::LanceMobility::countSafe(), osl::mobility::RookMobility::countVerticalBoth(), osl::effect_action::AlwaysMove< Action >::doAction(), osl::effect_action::BetterToPromote< Action >::doAction(), osl::effect_action::AlwaysMove< Action >::doActionPtype(), osl::effect_action::BetterToPromote< Action >::doActionPtype(), osl::effect::NumSimpleEffectTable::doBlockAt(), osl::NumEffectState::doCaptureMove(), osl::NumEffectState::doUndoCaptureMove(), osl::effect::EffectedNumTable::EffectedNumTable(), osl::SimpleState::emulateCapture(), osl::SimpleState::emulateHandPiece(), osl::eval::ml::BishopBishopPiece::eval(), osl::eval::ml::KingPieceRelative::eval(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::NonPawnAttackedPtype::eval(), osl::eval::ml::Pin::eval(), osl::eval::ml::PtypeX::eval(), osl::eval::ml::PtypeY::eval(), osl::eval::ml::PtypeYPawnY::eval(), osl::eval::ml::RookPromoteDefense::eval(), osl::eval::ml::RookRookPiece::eval(), osl::eval::ml::SilverAdvance26::eval(), osl::eval::ml::SimplePin::eval(), osl::eval::ml::BishopRookFork::evalOne(), osl::eval::ml::CheckShadowPtype::evalOne(), osl::eval::ml::EnterKingDefense::evalOne(), osl::eval::ml::KnightFork::evalOne(), osl::eval::ml::PinPtypeAll::evalOne(), osl::eval::ml::Promotion37::evalOne(), osl::eval::ml::NonPawnAttackedPtype::evalWithUpdateBang(), osl::eval::ml::PtypeYPawnY::evalWithUpdateBang(), osl::rating::AttackKing8Group::findMatch(), osl::rating::PatternGroup::findMatch(), osl::rating::PatternLongGroup2::findMatch(), osl::rating::PtypeAttackedGroup::findMatch(), osl::SimpleState::flipHorizontal(), osl::move_generator::Escape< Action >::generateEscape(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiece(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtypeUnsafe(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePieceUnsafe(), osl::eval::ml::KingPieceRelativeNoSupport::index(), osl::eval::ml::MajorGoldSilverAttacked< Opening >::index(), osl::eval::ml::PtypeX::index(), osl::eval::ml::PtypeY::index(), osl::rating::ImmediateAddSupport::index(), osl::rating::PinAttack::index(), osl::eval::ml::NonPawnAttackedPtypePair::index1(), osl::eval::ml::NonPawnAttacked::indexK(), osl::progress::ml::NewProgress::indexRelative(), osl::SimpleState::isConsistent(), isPlayerBasicPtype(), isPlayerPtype(), isPromotedNotKingGold(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::record::KisenPlusFile::load(), osl::move_probability::StateInfo::makePinOfLongPieces(), osl::move_probability::AttackFromOpposingSliders::match(), osl::move_probability::AttackKing8Long::match(), osl::move_probability::AttackToOpposingSliders::match(), osl::move_probability::CoverFork::match(), osl::move_probability::CoverPawn::match(), osl::move_probability::EscapeThreatened::match(), osl::move_probability::FromEffect::match(), osl::move_probability::LanceAttack::match(), osl::move_probability::OpposingPawn::match(), osl::move_probability::PromotionBySacrifice::match(), osl::rating::AttackKing8::match(), osl::rating::LongTarget2::match(), osl::rating::Pattern::match(), osl::rating::PinAttack::match(), osl::rating::PtypeAttacked::match(), osl::eval::ml::SilverFork::matchGold(), osl::eval::ml::SilverFork::matchRook(), osl::book::MiniBoard::MiniBoard(), osl::book::MiniBoardChar50::MiniBoardChar50(), osl::mobility::MobilityTable::MobilityTable(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::PieceBasicLessThan::operator()(), osl::operator<<(), osl::book::OPiece::OPiece(), Piece(), promote(), osl::progress::ml::NewProgress::promotion37One(), osl::SimpleState::rotate180(), osl::csa::show(), osl::ki2::show(), osl::record::myshogi::show(), osl::move_probability::PawnAttack::squareStatus(), osl::csa::strToMove(), osl::kakinoki::strToMove(), osl::psn::strToMove(), osl::eval::ml::PiecePairKing::sub(), osl::move_probability::ToEffect::supportAttack(), osl::eval::ml::NonPawnAttackedPtype::updateChanged(), osl::progress::ml::NewProgress::updatePieceKingRelativeBonus(), and osl::move_probability::StateInfo::updatePinnedGenerals().

◆ ptypeO()

PtypeO osl::Piece::ptypeO ( ) const
inline

Definition at line 824 of file basic_type.h.

References BitOffsetPtype, and piece.

Referenced by osl::move_probability::MoveInfo::adhocAdjustBreakThreatmate(), osl::eval::ml::PiecePair::adjust12One(), osl::eval::ml::PawnAdvanceUtil::cantAdvance(), osl::effect::NumSimpleEffectTable::doEffect(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::eval::ml::BishopHead::eval(), osl::eval::ml::BishopStandFile5::eval(), osl::eval::ml::LanceEffectPieceKingRelative::eval(), osl::eval::ml::PawnPtypeOPtypeO::eval(), osl::eval::ml::PieceEval::eval(), osl::eval::ml::BishopEffectBase::evalOne(), osl::eval::ml::King3Pieces::evalOne(), osl::eval::ml::RookEffectBase::evalOne(), osl::eval::ml::PawnPtypeOPtypeO::evalWithUpdate(), osl::effect_util::AdditionalEffect::find(), osl::eval::See::findAdditionalPieces(), osl::NumEffectState::forEachEffectOfPiece(), osl::hash::HashKey::HashKey(), osl::eval::ml::King25EffectEachBoth::index(), osl::eval::ml::PiecePair::index(), osl::eval::ml::PtypeYY::index(), osl::NumEffectState::inUnblockableCheck(), osl::SimpleState::isAlmostValidMove(), osl::move_probability::BreakThreatmate::isDefendingKing8(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::move_probability::PromotionBySacrifice::match(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::PiecePtypeMoreThan::operator()(), osl::operator==(), osl::record::KanjiPrint::print(), osl::NumEffectState::prologueCapture(), osl::NumEffectState::prologueDrop(), osl::NumEffectState::prologueSimple(), osl::progress::PtypeProgress::PtypeProgress(), osl::usi::show(), osl::effect_action::StorePtypeOSquare::store(), osl::eval::ml::PiecePair::sum12One(), osl::move_probability::PatternCommon::updateCacheOne(), osl::move_probability::StateInfo::updatePinnedGenerals(), osl::eval::ml::PiecePair::value(), osl::eval::ml::PiecePair::value(), and osl::eval::ml::PiecePair::valueCompiled().

◆ setSquare()

void osl::Piece::setSquare ( Square square)
inline

Definition at line 841 of file basic_type.h.

References piece, and square().

◆ square()

const Square osl::Piece::square ( ) const
inline

Definition at line 832 of file basic_type.h.

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

Referenced by osl::eval::ml::PiecePairKing::add(), osl::eval::ml::AttackMajorsInBase::addOne(), osl::eval::ml::MajorCheckWithCapture::addOne(), osl::move_probability::BlockLong::addPiece(), osl::eval::ml::PiecePairKing::addSub(), osl::move_probability::MoveInfo::adhocAdjustKeepCheckmateDefender(), osl::move_probability::MoveInfo::adhocAdjustSlider(), osl::checkmate::OracleAdjust::attack(), osl::rating::DefenseKing8::blocking(), 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::eval::See::computeValue(), osl::mobility::LanceMobility::countAll(), osl::mobility::BishopMobility::countAllDir(), osl::eval::ml::NumPiecesBetweenBishopAndKing::countBetween(), osl::mobility::BishopMobility::countBoth(), osl::mobility::LanceMobility::countBoth(), osl::mobility::RookMobility::countHorizontalBoth(), osl::mobility::RookMobility::countHorizontalSafe(), osl::mobility::BishopMobility::countSafe(), osl::mobility::LanceMobility::countSafe(), osl::mobility::RookMobility::countVerticalBoth(), osl::mobility::RookMobility::countVerticalSafe(), osl::move_probability::CoverFork::defending(), osl::effect_action::AlwaysMove< Action >::doAction(), osl::effect_action::BetterToPromote< Action >::doAction(), osl::effect_action::AlwaysMove< Action >::doActionPtype(), osl::effect_action::BetterToPromote< Action >::doActionPtype(), osl::effect::NumSimpleEffectTable::doBlockAt(), osl::effect::NumSimpleEffectTable::doEffect(), osl::effect::EffectedNumTable::EffectedNumTable(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::SimpleState::emulateCapture(), osl::SimpleState::emulateHandPiece(), osl::eval::ml::BishopBishopPiece::eval(), osl::eval::ml::BishopEffectBase::eval(), osl::eval::ml::BishopHead::eval(), osl::eval::ml::BishopSilverKnight::eval(), osl::eval::ml::KingPieceRelative::eval(), osl::eval::ml::KnightAdvance::eval(), osl::eval::ml::KnightHead::eval(), osl::eval::ml::LanceMobilityAll::eval(), osl::eval::ml::NonPawnAttackedPtype::eval(), osl::eval::ml::PawnAdvance::eval(), osl::eval::ml::PawnPtypeOPtypeO::eval(), osl::eval::ml::PtypeX::eval(), osl::eval::ml::PtypeY::eval(), osl::eval::ml::PtypeYPawnY::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::RookRookPiece::eval(), osl::eval::ml::RookSilverKnight::eval(), osl::eval::ml::BishopExchangeSilverKing::evalOne(), osl::eval::ml::BishopRookFork::evalOne(), osl::eval::ml::CheckShadowPtype::evalOne(), osl::eval::ml::GoldFeatures::evalOne(), osl::eval::ml::King25Effect3::evalOne(), osl::eval::ml::King25EmptySquareNoEffect::evalOne(), osl::eval::ml::King25EmptySquareNoEffect::evalOne(), osl::eval::ml::KnightFork::evalOne(), osl::eval::ml::MajorGoldSilverAttacked< Opening >::evalOne(), osl::eval::ml::PiecePairKing::evalOne(), osl::eval::ml::PinPtypeAll::evalOne(), osl::eval::ml::PromotedMinorPieces::evalOne(), osl::eval::ml::SilverFeatures::evalOne(), osl::eval::ml::King8EffectEmptySquare< false >::evalWithUpdate(), osl::eval::ml::PiecePair::evalWithUpdate(), osl::eval::ml::PawnAdvanceAll::evalWithUpdateBang(), osl::effect_util::AdditionalEffect::find(), osl::rating::PatternLong2::find(), osl::eval::See::findAdditionalPieces(), osl::eval::See::findEffectPiecesAfterMove(), osl::SimpleState::flipHorizontal(), osl::NumEffectState::forEachEffectOfPiece(), osl::move_generator::Escape< Action >::generateEscape(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiece(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtype(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtypeUnsafe(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePieceUnsafe(), osl::effect_util::AdditionalEffect::hasEffect(), osl::NumEffectState::hasEffectInDirection(), osl::hash::HashKey::HashKey(), osl::eval::ml::KingPieceRelative::index(), osl::eval::ml::KingPieceRelativeNoSupport::index(), osl::eval::ml::KingRookBishop::index(), osl::eval::ml::MajorY< Opening, MajorBasic >::index(), osl::eval::ml::PiecePair::index(), osl::eval::ml::Pin::index(), osl::eval::ml::PtypeX::index(), osl::eval::ml::PtypeY::index(), osl::eval::ml::PtypeYY::index(), osl::eval::ml::RookPawnY::index(), osl::eval::ml::RookRook::index(), osl::rating::ImmediateAddSupport::index(), osl::rating::PinAttack::index(), osl::eval::ml::NonPawnAttackedPtypePair::index1(), osl::eval::ml::NonPawnAttacked::indexK(), osl::progress::ml::NewProgress::indexRelative(), osl::eval::ml::PawnDropBoth::indexX(), osl::eval::ml::PawnDropBoth::indexY(), osl::eval::ml::RookPawnY::indexY(), osl::SimpleState::initPawnMask(), osl::NumEffectState::inUnblockableCheck(), osl::NumEffectState::isConsistent(), osl::SimpleState::isConsistent(), osl::move_probability::BreakThreatmate::isDefendingKing8(), osl::move_classifier::PawnDropCheckmate< P >::isMember(), isOnBoard(), osl::SimpleState::kingSquare(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::move_probability::MoveFromOpposingSliders::longPtype(), osl::checkmate::King8Info::make(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::move_probability::StateInfo::makePinOfLongPieces(), osl::move_probability::AttackKing8Long::match(), osl::move_probability::AttackToOpposingSliders::match(), osl::move_probability::CoverFork::match(), osl::move_probability::EscapeThreatened::match(), osl::move_probability::LongRecapture::match(), osl::move_probability::PromotionBySacrifice::match(), osl::rating::PinAttack::match(), osl::rating::RookDefense::match(), osl::eval::ml::SilverFork::matchGold(), osl::eval::ml::SilverFork::matchRook(), osl::book::MiniBoard::MiniBoard(), osl::book::MiniBoardChar50::MiniBoardChar50(), osl::mobility::MobilityTable::MobilityTable(), osl::NumEffectState::NumEffectState(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::operator<<(), osl::book::OPiece::OPiece(), osl::book::OSquare::OSquare(), osl::eval::ml::PinPtypeAll::pawnAttack(), Piece(), osl::eval::ml::PiecePair::pieceValueDouble(), osl::NumEffectState::pinnedCanMoveTo(), osl::NumEffectState::pinnedDir(), osl::progress::PtypeProgress::PtypeProgress(), osl::SimpleState::rotate180(), setSquare(), osl::ki2::show(), osl::record::myshogi::show(), osl::effect_action::StorePtypeOSquare::store(), osl::eval::ml::PiecePairKing::sub(), osl::eval::ml::NonPawnAttackedPtype::updateChanged(), osl::eval::ml::OpenMidEndingEval::updateGoldSilverNearKing(), osl::progress::ml::NewProgress::updatePawnFacing(), osl::move_probability::StateInfo::updatePinnedGenerals(), osl::eval::ml::PiecePair::value(), osl::eval::ml::PiecePair::value(), and osl::eval::ml::PiecePair::valueCompiled().

◆ unpromote()

const Piece osl::Piece::unpromote ( ) const
inline

Definition at line 871 of file basic_type.h.

References Piece(), Piece(), and piece.

Member Data Documentation

◆ BitOffsetMovePromote

const int osl::Piece::BitOffsetMovePromote =BitOffsetPromote+4
static

Definition at line 801 of file basic_type.h.

Referenced by promoteWithMask().

◆ BitOffsetPromote

const int osl::Piece::BitOffsetPromote =BitOffsetPtype+3
static

Definition at line 800 of file basic_type.h.

Referenced by promoteWithMask().

◆ BitOffsetPtype

const int osl::Piece::BitOffsetPtype =16
static

◆ piece

◆ SIZE


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