片方の手番の持駒の枚数を記録するクラス. [詳細]
#include <pieceStand.h>
Public メソッド | |
PieceStand (unsigned int value=0) | |
PieceStand (Player, const SimpleState &) | |
PieceStand (int pawnCount, int lanceCount, int knightCount, int silverCount, int goldCount, int bishopCount, int rookCount, int kingCount) | |
void | add (Ptype type, unsigned int num=1) |
void | sub (Ptype type, unsigned int num=1) |
void | tryAdd (Ptype type) |
加算可能なら加える. | |
bool | canAdd (Ptype type) const |
void | trySub (Ptype type) |
1枚以上持っていれば減らす | |
bool | atMostOneKind () const |
一種類の駒しかない | |
void | addAtmostOnePiece (PieceStand const &ps) |
pieceStand同士の加算,減算. | |
void | subAtmostOnePiece (PieceStand const &ps) |
unsigned int | get (Ptype type) const |
void | carriesOff () const |
void | carriesOn () const |
unsigned int | testCarries () const |
bool | isSuperiorOrEqualTo (PieceStand other) const |
template<Player P> | |
bool | hasMoreThan (PieceStand other) const |
this と other が BLACK の持駒と考えた時に, this の方が同じか沢山持っていれば真. | |
bool | hasMoreThan (Player P, PieceStand other) const |
unsigned int | getFlags () const |
bool | any () const |
どれかの駒を一枚でも持っている | |
const PieceStand | max (PieceStand other) const |
種類毎に this と other の持駒の多い方を取る | |
const PieceStand | max2 (PieceStand other) const |
種類毎に this と other の持駒の多い方を取る (max のalternative) | |
const PieceStand | nextStand (Player pl, Move move) const |
const PieceStand | nextStand (Move move) const |
const PieceStand | previousStand (Player pl, Move move) const |
const PieceStand | previousStand (Move move) const |
Static Public 変数 | |
static const CArray< Ptype, 7 > | order |
持駒の表示で良く使われる順番. | |
static const unsigned int | carryMask = 0x48822224 |
Private メソッド | |
bool | carryUnchangedAfterAdd (const PieceStand &original, const PieceStand &other) const |
bool | carryUnchangedAfterSub (const PieceStand &original, const PieceStand &other) const |
Private 変数 | |
unsigned int | flags |
Static Private 変数 | |
static const CArray< unsigned char, PTYPE_MAX+1 > | shift |
static const CArray< unsigned char, PTYPE_MAX+1 > | mask |
片方の手番の持駒の枚数を記録するクラス.
== を軽くするために carry off の状態を基本とする
bits/pieceStand.h の 37 行で定義されています。
osl::PieceStand::PieceStand | ( | unsigned int | value = 0 |
) | [inline, explicit] |
bits/pieceStand.h の 48 行で定義されています。
osl::PieceStand::PieceStand | ( | Player | pl, | |
const SimpleState & | state | |||
) | [explicit] |
pieceStand.cc の 32 行で定義されています。
osl::PieceStand::PieceStand | ( | int | pawnCount, | |
int | lanceCount, | |||
int | knightCount, | |||
int | silverCount, | |||
int | goldCount, | |||
int | bishopCount, | |||
int | rookCount, | |||
int | kingCount | |||
) | [inline] |
bits/pieceStand.h の 52 行で定義されています。
参照先 add(), osl::BISHOP, osl::GOLD, osl::KING, osl::KNIGHT, osl::LANCE, osl::PAWN, osl::ROOK, と osl::SILVER.
void osl::PieceStand::add | ( | Ptype | type, | |
unsigned int | num = 1 | |||
) | [inline] |
bits/pieceStand.h の 68 行で定義されています。
参照先 flags, osl::isBasic(), mask, shift, と testCarries().
参照元 osl::checkmate::ProofPiecesUtil::addMonopolizedPieces(), osl::checkmate::Dfpn::attack(), nextStand(), PieceStand(), osl::checkmate::Dfpn::proofOracleAttack(), osl::PieceStandIO::readNumbers(), osl::checkmate::FixedDepthSolverExt::SetProofPieces::setAttackLeaf(), と tryAdd().
void osl::PieceStand::addAtmostOnePiece | ( | PieceStand const & | ps | ) | [inline] |
pieceStand同士の加算,減算.
足して良いのは,carry が立っていないpiecestandで かつ,含まれる駒が高々1つ
bits/pieceStand.h の 108 行で定義されています。
参照先 atMostOneKind(), carryUnchangedAfterAdd(), flags, getFlags(), と testCarries().
bool osl::PieceStand::any | ( | ) | const [inline] |
bool osl::PieceStand::atMostOneKind | ( | ) | const |
bool osl::PieceStand::canAdd | ( | Ptype | type | ) | const |
pieceStand.cc の 39 行で定義されています。
参照先 osl::PtypeTable::getIndexLimit(), osl::PtypeTable::getIndexMin(), max(), と osl::Ptype_Table.
参照元 tryAdd().
void osl::PieceStand::carriesOff | ( | ) | const [inline] |
void osl::PieceStand::carriesOn | ( | ) | const [inline] |
bool osl::PieceStand::carryUnchangedAfterAdd | ( | const PieceStand & | original, | |
const PieceStand & | other | |||
) | const [private] |
bool osl::PieceStand::carryUnchangedAfterSub | ( | const PieceStand & | original, | |
const PieceStand & | other | |||
) | const [private] |
unsigned int osl::PieceStand::get | ( | Ptype | type | ) | const [inline] |
bits/pieceStand.h の 131 行で定義されています。
参照元 osl::checkmate::ProofPiecesUtil::addMonopolizedPieces(), osl::checkmate::ProofPieces::attack(), osl::checkmate::DisproofPieces::defense(), osl::operator<<(), osl::hash::HashKey128::StandHash::toUint64(), osl::checkmate::Dfpn::ProofOracle::traceable(), と osl::PieceStandIO::writeNumbers().
unsigned int osl::PieceStand::getFlags | ( | ) | const [inline] |
bool osl::PieceStand::hasMoreThan | ( | Player | P, | |
PieceStand | other | |||
) | const [inline] |
bits/pieceStand.h の 158 行で定義されています。
参照先 osl::BLACK.
bool osl::PieceStand::hasMoreThan | ( | PieceStand | other | ) | const [inline] |
this と other が BLACK の持駒と考えた時に, this の方が同じか沢山持っていれば真.
bits/pieceStand.h の 151 行で定義されています。
参照先 osl::BLACK, と isSuperiorOrEqualTo().
bool osl::PieceStand::isSuperiorOrEqualTo | ( | PieceStand | other | ) | const [inline] |
const PieceStand osl::PieceStand::max | ( | PieceStand | other | ) | const [inline] |
種類毎に this と other の持駒の多い方を取る
bits/pieceStand.h の 171 行で定義されています。
参照先 carryMask, flags, と PieceStand().
参照元 osl::checkmate::DfpnTable::List::addDag(), canAdd(), osl::checkmate::Dfpn::Node::setCheckmateChildInDefense(), osl::checkmate::Dfpn::Node::setNoCheckmateChildInAttack(), osl::checkmate::DfpnTable::List::store(), と osl::checkmate::FixedDepthSolverExt::SetProofPieces::updateMax().
const PieceStand osl::PieceStand::max2 | ( | PieceStand | other | ) | const [inline] |
種類毎に this と other の持駒の多い方を取る (max のalternative)
bits/pieceStand.h の 187 行で定義されています。
参照先 carryMask, flags, と PieceStand().
const PieceStand osl::PieceStand::nextStand | ( | Player | pl, | |
Move | move | |||
) | const [inline] |
bits/pieceStand.h の 203 行で定義されています。
参照先 add(), osl::Move::capturePtype(), osl::Move::isDrop(), osl::Move::isNormal(), osl::Move::player(), osl::Move::ptype(), と osl::unpromote().
参照元 osl::checkmate::Dfpn::ProofOracle::newOracle(), nextStand(), osl::checkmate::Dfpn::Node::nextWhiteStand(), と osl::checkmate::ProofTreeDepthDfpn::orNode().
const PieceStand osl::PieceStand::nextStand | ( | Move | move | ) | const [inline] |
bits/pieceStand.h の 222 行で定義されています。
参照先 nextStand(), と osl::Move::player().
const PieceStand osl::PieceStand::previousStand | ( | Player | pl, | |
Move | move | |||
) | const [inline] |
const PieceStand osl::PieceStand::previousStand | ( | Move | move | ) | const [inline] |
bits/pieceStand.h の 246 行で定義されています。
参照先 osl::Move::player(), と previousStand().
void osl::PieceStand::sub | ( | Ptype | type, | |
unsigned int | num = 1 | |||
) | [inline] |
void osl::PieceStand::subAtmostOnePiece | ( | PieceStand const & | ps | ) | [inline] |
bits/pieceStand.h の 118 行で定義されています。
参照先 atMostOneKind(), carryUnchangedAfterSub(), flags, getFlags(), と testCarries().
unsigned int osl::PieceStand::testCarries | ( | ) | const [inline] |
void osl::PieceStand::tryAdd | ( | Ptype | type | ) |
void osl::PieceStand::trySub | ( | Ptype | type | ) | [inline] |
const unsigned int osl::PieceStand::carryMask = 0x48822224 [static] |
bits/pieceStand.h の 42 行で定義されています。
参照元 carriesOff(), carriesOn(), isSuperiorOrEqualTo(), max(), max2(), と testCarries().
unsigned int osl::PieceStand::flags [mutable, private] |
bits/pieceStand.h の 46 行で定義されています。
参照元 add(), addAtmostOnePiece(), any(), carriesOff(), carriesOn(), get(), getFlags(), isSuperiorOrEqualTo(), max(), max2(), sub(), subAtmostOnePiece(), と testCarries().
const CArray< unsigned char, PTYPE_MAX+1 > osl::PieceStand::mask [static, private] |
{{ 0,0,0,0,0,0,0,0, (1<<2)-1, (1<<3)-1, (1<<5)-1, (1<<3)-1, (1<<3)-1, (1<<3)-1, (1<<2)-1, (1<<2)-1 }}
bits/pieceStand.h の 45 行で定義されています。
const CArray< Ptype, 7 > osl::PieceStand::order [static] |
{{ ROOK, BISHOP, GOLD, SILVER, KNIGHT, LANCE, PAWN, }}
持駒の表示で良く使われる順番.
KINGや成駒は -1
bits/pieceStand.h の 41 行で定義されています。
参照元 osl::checkmate::ProofPiecesUtil::addMonopolizedPieces(), osl::eval::ml::NonPawnPieceStandTurn::eval(), osl::eval::ml::PieceStand::eval(), osl::SimpleState::initPawnMask(), osl::SimpleState::isConsistent(), osl::record::KisenPlusFile::load(), osl::move_probability::SacrificeAttack::match(), osl::progress::ml::NewProgress::NewProgress(), osl::eval::ml::OpenMidEndingEval::OpenMidEndingEval(), osl::operator<<(), PieceStand(), osl::record::KanjiPrint::print(), osl::PieceStandIO::readNumbers(), osl::record::KisenWriter::save(), osl::eval::ml::PieceStandY::setUp(), osl::usi::show(), osl::record::myshogi::show(), osl::move_probability::MoveInfo::standIndex(), osl::progress::ml::NewProgress::updatePieceStand7(), と osl::PieceStandIO::writeNumbers().
const CArray< unsigned char, PTYPE_MAX+1 > osl::PieceStand::shift [static, private] |
{{ 0,0,0,0,0,0,0,0, 28, 24, 18, 14, 10, 6, 3, 0, }}
bits/pieceStand.h の 44 行で定義されています。