|
My Project
|
#include <basic_type.h>
Public Types | |
| enum | { PIECE_STAND =0, MIN =0, SIZE =0x100 } |
Public Member Functions | |
| unsigned int | uintValue () const |
| Square () | |
| Square (int x, int y) | |
| int | x () const |
| 将棋としてのX座標を返す. More... | |
| int | y () const |
| 将棋としてのY座標を返す. More... | |
| int | y1 () const |
| y+1を返す More... | |
| unsigned int | index () const |
| int | indexForOffset32 () const |
| bool | isPieceStand () const |
| bool | isOnBoardSlow () const |
| bool | isOnBoard () const |
| 盤面上を表すかどうかの判定. 1<=x() && x()<=9 && 1<=y() && y()<=9 Squareの内部表現に依存する. More... | |
| bool | isEdge () const |
| onBoardから8近傍のオフセットを足した点がedgeかどうかの判定 そこそこ速くなった. More... | |
| bool | isValid () const |
| const Square | squareForBlack (Player player) const |
| template<Player P> | |
| const Square | squareForBlack () const |
| 後手の場合は盤面を引っくり返す. More... | |
| const Square | rotate180 () const |
| const Square | rotate180EdgeOK () const |
| const Square | rotate180Safe () const |
| const Square | flipHorizontal () const |
| bool | isOnBoardRegion () const |
| squareがONBOARD_MINとONBOARD_MAXの間にある More... | |
| Square & | operator++ () |
| template<Player P> | |
| bool | canPromote () const |
| bool | canPromote (Player player) const |
| bool | isULRD (Square sq) const |
| 2つのSquare(onBoardであることが前提)が, xが等しいかyが等しい More... | |
| bool | isUD (Square sq) const |
| 2つのSquare(onBoardであることが前提)のxが等しい More... | |
| template<Player P> | |
| bool | isU (Square sq) const |
| sqがPlayer Pにとって上 More... | |
| bool | isLR (Square sq) const |
| 2つのSquare(onBoardであることが前提)のyが等しい More... | |
| Square & | operator+= (Offset offset) |
| Square & | operator-= (Offset offset) |
| const Square | operator+ (Offset offset) const |
| const Square | operator- (Offset offset) const |
| const Offset | operator- (Square other) const |
| template<int Y> | |
| bool | yEq () |
| template<int Y> | |
| std::enable_if< Y!=2, bool >::type | yLe () |
| template<int Y> | |
| std::enable_if< Y==2, bool >::type | yLe () |
| template<int Y> | |
| std::enable_if< Y!=7, bool >::type | yGe () |
| template<int Y> | |
| std::enable_if< Y==7, bool >::type | yGe () |
| template<Player P, Direction D> | |
| const Square | neighbor () const |
| template<Player P, Direction D> | |
| const Square | back () const |
| const Square | neighbor (Player P, Direction D) const |
| const Square | back (Player P, Direction D) const |
| bool | isNeighboring8 (Square to) const |
Static Public Member Functions | |
| static const Square | makeDirect (int value) |
| static const Square | STAND () |
| static const Square | makeNoCheck (int x, int y) |
| assertなしに作る More... | |
| static const Square | nth (unsigned int i) |
| static unsigned int | indexMax () |
| static const Square | onBoardMax () |
| static const Square | onBoardMin () |
| static int | reverseX (int x) |
| static int | reverseY (int y) |
| template<Player P> | |
| static bool | canPromoteY (int y) |
Private Member Functions | |
| Square (int p) | |
Private Attributes | |
| unsigned int | square |
Definition at line 531 of file basic_type.h.
| anonymous enum |
| Enumerator | |
|---|---|
| PIECE_STAND | |
| MIN | |
| SIZE | |
Definition at line 540 of file basic_type.h.
|
inlineexplicitprivate |
Definition at line 534 of file basic_type.h.
|
inline |
Definition at line 545 of file basic_type.h.
Referenced by flipHorizontal(), makeDirect(), makeNoCheck(), nth(), onBoardMax(), onBoardMin(), rotate180EdgeOK(), squareForBlack(), and STAND().
|
inline |
Definition at line 549 of file basic_type.h.
|
inline |
Definition at line 750 of file basic_type.h.
Referenced by osl::eval::ml::KnightFork::accumulate().
| const osl::Square osl::Square::back | ( | Player | P, |
| Direction | D | ||
| ) | const |
Definition at line 196 of file basic_type.cc.
References osl::alt(), osl::Board_Table, osl::D, and osl::BoardTable::nextSquare().
|
inline |
Definition at line 659 of file basic_type.h.
Referenced by osl::eval::ml::MajorCheckWithCapture::addOne(), osl::ShouldPromoteCut::canIgnore(), osl::eval::See::computeValue(), 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::checkmate::PawnCheckmateMoves::effectiveOnlyIfPawnCheckmate(), osl::eval::ml::RookPawn< Opening >::eval(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePiecePtypeUnsafe(), osl::move_generator::PieceOnBoard< Action, noCapturePromote >::generatePieceUnsafe(), osl::Move::ignoreUnpromote(), osl::rating::Karanari::index(), osl::rating::LongTarget::isPromotable(), osl::SimpleState::isValidMoveByRule(), osl::checkmate::ProofNumberTable::libertyAfterAllMove(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::progress::Effect5x3WithBonus::makeProgressAreaBonus(), osl::rating::Karanari::match(), osl::move_probability::SeeFeature::match(), osl::move_probability::PatternBase< TestPromotable >::match(), osl::move_probability::DropAfterOpposingPawn::match(), osl::move_probability::PromotionBySacrifice::match(), osl::rating::Karanari::matchGeneral(), osl::eval::ml::SilverFork::matchGold(), osl::move_probability::PawnAttack::matchPtype(), osl::eval::ml::SilverFork::matchRook(), osl::ki2::show(), osl::psn::showXP(), and osl::move_probability::PatternCommon::updateCacheOne().
|
inline |
Definition at line 662 of file basic_type.h.
References osl::BLACK, and uintValue().
|
inlinestatic |
Definition at line 655 of file basic_type.h.
References osl::BLACK.
|
inline |
Definition at line 628 of file basic_type.h.
References isPieceStand(), Square(), x(), and y().
Referenced by osl::SimpleState::flipHorizontal(), osl::eval::ml::PiecePairKing::indexKing(), and osl::eval::ml::PiecePairKing::indexPiece().
|
inline |
Definition at line 572 of file basic_type.h.
Referenced by osl::hash::HashGenTable::addHashKey(), osl::move_probability::PatternCommon::addOne(), osl::move_probability::BishopAttack::addSquare(), osl::Centering3x3::adjustCenter(), osl::Centering5x3::adjustCenter(), osl::container::BoardMaskTable3x3::BoardMaskTable3x3(), osl::container::BoardMaskTable5x3Center::BoardMaskTable5x3Center(), osl::container::BoardMaskTable5x5::BoardMaskTable5x5(), osl::SquareCompressor::compress(), osl::NumEffectState::copyFrom(), osl::effect::NumSimpleEffectTable::copyFrom(), osl::effect::NumSimpleEffectTable::doBlockAt(), osl::effect::NumSimpleEffectTable::doEffectLong(), osl::effect::NumSimpleEffectTable::doEffectShort(), osl::effect::NumSimpleEffectTable::effectSetAt(), osl::rating::PatternGroup::findMatch(), osl::PathEncodingTable::get(), osl::progress::Effect5x3Table::getAttackEffect(), osl::progress::Effect5x3Table::getDefenseEffect(), osl::SimpleState::getPiecePtr(), osl::rating::CountEffect2::index(), osl::container::BoardMask::index(), osl::Centering3x3::Table::init(), osl::progress::PtypeProgressTable::init(), osl::checkmate::EdgeTable::init(), osl::SquareCompressor::Initializer::Initializer(), isOnBoardRegion(), osl::container::BoardMaskTable5x5::mask(), osl::container::BoardMaskTable3x3::mask(), osl::container::BoardMaskTable5x3Center::mask(), osl::move_probability::LanceAttack::match(), osl::move_probability::BreakThreatmate::match(), osl::move_probability::operator==(), osl::rating::PatternGroup::PatternGroup(), osl::SimpleState::pieceAt(), osl::progress::PtypeProgressTable::progress(), osl::checkmate::EdgeTable::resetEdgeFromLiberty(), osl::SimpleState::setBoard(), osl::progress::Effect5x3Table::setupAttackEffect(), osl::progress::Effect5x3Table::setupDefenseEffect(), osl::hash::HashGenTable::subHashKey(), osl::Centering5x3::Table::Table(), and osl::move_probability::PatternCommon::updateCacheOne().
|
inline |
Definition at line 574 of file basic_type.h.
References square.
|
inlinestatic |
Definition at line 573 of file basic_type.h.
|
inline |
onBoardから8近傍のオフセットを足した点がedgeかどうかの判定 そこそこ速くなった.
Definition at line 591 of file basic_type.h.
References isPieceStand(), square, x(), and y().
Referenced by osl::move_classifier::PawnDropCheckmate< P >::canEscape(), osl::effect::EffectedNumTable::EffectedNumTable(), osl::effect_util::Neighboring8Direct::Table::findNearest(), osl::effect_util::Neighboring8Direct::Table::hasEffect(), osl::effect_util::Neighboring8Direct::Table::hasEffectOrAdditional(), and osl::move_probability::BlockLong::makeLongAttackOne().
|
inline |
2つのSquare(onBoardであることが前提)のyが等しい
Definition at line 701 of file basic_type.h.
References isOnBoard(), and uintValue().
| bool osl::Square::isNeighboring8 | ( | Square | to | ) | const |
Definition at line 202 of file basic_type.cc.
References osl::Board_Table, and osl::BoardTable::getShortOffsetNotKnight().
Referenced by osl::checkmate::ProofNumberTable::countLiberty(), osl::checkmate::ProofNumberTable::countLibertyLong(), osl::checkmate::ProofNumberTable::countLibertyShortNotKnight(), osl::checkmate::CheckmateIfCapture::effectiveAttackCandidate0(), osl::rating::Karanari::index(), osl::rating::Threatmate::isCandidate(), osl::move_probability::BreakThreatmate::isOpeningKingRoad(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::rating::Karanari::match(), osl::rating::DefenseKing8::matchDrop(), and osl::rating::DefenseKing8::matchMove().
|
inline |
盤面上を表すかどうかの判定. 1<=x() && x()<=9 && 1<=y() && y()<=9 Squareの内部表現に依存する.
Definition at line 583 of file basic_type.h.
References square.
Referenced by osl::eval::ml::KnightCheck::canCheck(), osl::eval::ml::GoldFeatures::canMoveToSide(), osl::rating::CountEffect2::count(), osl::NumEffectState::countEffect(), osl::mobility::countMobilityBoth(), osl::eval::ml::King8EffectAll::effectState(), osl::eval::ml::RookRookPiece::eval(), osl::eval::ml::PawnPtypeOPtypeO::eval(), osl::eval::ml::LanceEffectPieceKingRelative::eval(), osl::eval::ml::King25EmptyAbs< Opening >::evalOne(), osl::eval::ml::SilverFeatures::evalOne(), osl::eval::ml::PawnPtypeOPtypeO::evalWithUpdate(), osl::move_probability::ToEffect::find(), osl::progress::Effect5x3Table::getAttackEffect(), osl::progress::Effect5x3Table::getDefenseEffect(), osl::PtypeTable::getEffect(), osl::PtypeTable::getEffectNotLongU(), osl::BoardTable::getShort8(), osl::effect_util::Neighboring8Direct::Table::hasEffect(), osl::NumEffectState::hasEffectAt(), osl::NumEffectState::hasEffectByNotPinned(), osl::NumEffectState::hasEffectByNotPinnedAndKing(), osl::NumEffectState::hasEffectByPiece(), osl::effect_util::Neighboring8Direct::hasEffectFromTo(), osl::rating::CountEffect2::index(), osl::eval::ml::BishopExchangeSilverKing::indexRook(), osl::SimpleState::isConsistent(), osl::SimpleState::isEmptyBetween(), isLR(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), osl::rating::LongTarget::isPromotable(), isU(), isUD(), isULRD(), osl::Move::isValid(), osl::Move::Move(), osl::rating::PatternLong::nextPieceOrEnd(), osl::rating::Pattern::nextSquare(), osl::BoardTable::nextSquare(), osl::eval::ml::PinPtypeAll::pawnAttack(), osl::SimpleState::pieceOnBoard(), and osl::eval::ml::PiecePair::sanitize().
|
inline |
squareがONBOARD_MINとONBOARD_MAXの間にある
Definition at line 641 of file basic_type.h.
References index(), onBoardMax(), and onBoardMin().
Referenced by osl::move_probability::PatternCommon::addOne().
| bool osl::Square::isOnBoardSlow | ( | ) | const |
Definition at line 178 of file basic_type.cc.
|
inline |
Definition at line 576 of file basic_type.h.
References PIECE_STAND, and square.
Referenced by osl::move_probability::MoveInfo::adhocAdjustBishopFork(), osl::checkmate::LibertyEstimator::attackH(), osl::checkmate::attackProofCost(), osl::ShouldPromoteCut::canIgnore(), osl::eval::ml::BishopRookFork::evalOne(), osl::eval::ml::PiecePair::evalWithUpdate(), osl::eval::ml::PiecePair::evalWithUpdateCompiled(), osl::eval::ml::BishopRookFork::findDropInLine(), osl::rating::AttackKing8Group::findMatch(), flipHorizontal(), osl::NumEffectState::inCheck(), osl::eval::ml::PiecePair::index(), osl::rating::CountOpen::index(), osl::SimpleState::initPawnMask(), osl::SimpleState::isAlmostValidMove(), osl::NumEffectState::isAlmostValidMove(), osl::SimpleState::isConsistent(), osl::Move::isDrop(), isEdge(), osl::move_classifier::SafeMove< P >::isMember(), osl::move_classifier::Check< P >::isMember(), osl::move_classifier::PawnDropCheckmate< P >::isMember(), osl::move_classifier::KingOpenMove< P >::isMemberMain(), osl::Piece::isOnBoard(), osl::SimpleState::isValidMoveByRule(), osl::move_probability::BlockLong::makeLongAttackOne(), osl::NumEffectState::makeMove(), osl::NumEffectState::makePinOpen(), osl::NumEffectState::makeUnmakeMove(), osl::rating::AttackKing8::match(), osl::rating::RookDefense::match(), osl::move_probability::MoveFromOpposingSliders::match(), osl::eval::ml::SilverFork::matchGold(), osl::eval::ml::