osl::effect_util::Pin Class Reference

- Main Page
- Namespaces
- Classes
- Files

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Static Public Member Functions | Static Private Member Functions | List of all members
osl::effect_util::Pin Class Reference

素抜きがあるため動けない駒を求める. More...

`#include <pin.h>`

## Static Public Member Functions
static PieceMask | makeNaive (const SimpleState &state, Square target, Player defense)
| 8方向計算する方法 More...
static PieceMask | makeByPiece (const NumEffectState &state, Square target, Player defense)
| 飛車角は駒の位置から判断する計算方法. More...
static PieceMask | makeByPieceKing (const NumEffectState &state, Square target, Player defense)
| 飛車角は駒の位置から判断, KINGに特化 More...
template<Player Defense, Direction DIR>
static void | findDirectionStep (const NumEffectState &state, Square target, PieceMask &pins)
| 駒から8近傍をサーチしていって，その方向の利きがあるか? More...
template<Player Defense>
static PieceMask | makeStep (const NumEffectState &state, Square target)
static PieceMask | makeStep (const NumEffectState &state, Square target, Player defense)
template<Player Defense>
static PieceMask | makeStep1 (const NumEffectState &state, Square target)
static PieceMask | makeStep1 (const NumEffectState &state, Square target, Player defense)
static PieceMask | make (const NumEffectState &state, Square target, Player defense)
| pin されている駒を計算する More...
static PieceMask | make (const NumEffectState &state, Player defense)
| defense の王を守るために pin されている駒を計算する More...
static PieceMask | makeNaive (const SimpleState &state, Player defense)
static PieceMask | makeByPiece (const NumEffectState &state, Player defense)
static int | count (const NumEffectState &state, Player defense)
| defense の王について pin されている駒を計算する More...
static int | count (const NumEffectState &state, Square target, Player defense)

## Static Private Member Functions
template<Direction DIR>
static void | findDirection (const SimpleState &state, Square target, Player defense, PieceMask &pins)
template<Player P>
static void | findLance (const NumEffectState &state, Square target, PieceMask &pins)
| targetにはdefenseのKINGがあるという前提 Pはdefense targetにdefenseのlanceがあると働かない． More...
static bool | hasEffectWithOffset (const SimpleState &state, Piece attack_piece, Piece pin, Offset diff)
static bool | hasEffectWithOffset (const NumEffectState &state, Piece attack_piece, Piece pin, Offset)
static void | findOffset (const NumEffectState &state, Piece attack_piece, Square target, Player defense, Offset diff, PieceMask &pins)
template<Ptype PTYPE>
static void | findPtype (const NumEffectState &state, Square target, Player attack, Player defense, PieceMask &result)

## Detailed Description

素抜きがあるため動けない駒を求める.

TODO: 差分計算で高速に更新する

Definition at line 69 of file effect_util/pin.h.

## Member Function Documentation

static int osl::effect_util::Pin::count | ( | const NumEffectState & | state,
|  | Player | defense
| ) |  |
| inlinestatic

defense の王について pin されている駒を計算する

Definition at line 280 of file effect_util/pin.h.

References make().

static int osl::effect_util::Pin::count | ( | const NumEffectState & | state,
|  | Square | target,
|  | Player | defense
| ) |  |
| inlinestatic

Definition at line 285 of file effect_util/pin.h.

References make().

template<Direction DIR>

static void osl::effect_util::Pin::findDirection | ( | const SimpleState & | state,
|  | Square | target,
|  | Player | defense,
|  | PieceMask & | pins
| ) |  |
| inlinestaticprivate

Definition at line 73 of file effect_util/pin.h.

References osl::alt(), osl::Board_Table, osl::PtypeTable::getMoveMask(), osl::BoardTable::getOffset(), osl::Piece::isOnBoardByOwner(), osl::Piece::number(), osl::Piece::ptype(), osl::Ptype_Table, and osl::Piece::square().

template<Player Defense, Direction DIR>

static void osl::effect_util::Pin::findDirectionStep | ( | const NumEffectState & | state,
|  | Square | target,
|  | PieceMask & | pins
| ) |  |
| inlinestatic

駒から8近傍をサーチしていって，その方向の利きがあるか?

Definition at line 186 of file effect_util/pin.h.

References osl::BLACK, osl::DirectionTraits< Dir >::blackOffset(), osl::Piece::isEdgeNum(), osl::Piece::isEmptyNum(), and osl::Piece::isPieceNum().

template<Player P>

static void osl::effect_util::Pin::findLance | ( | const NumEffectState & | state,
|  | Square | target,
|  | PieceMask & | pins
| ) |  |
| inlinestaticprivate

targetにはdefenseのKINGがあるという前提 Pはdefense targetにdefenseのlanceがあると働かない．

Definition at line 91 of file effect_util/pin.h.

References osl::Piece::EMPTY(), osl::Piece::isOnBoardByOwner(), and osl::Piece::number().

static void osl::effect_util::Pin::findOffset | ( | const NumEffectState & | state,
|  | Piece | attack_piece,
|  | Square | target,
|  | Player | defense,
|  | Offset | diff,
|  | PieceMask & | pins
| ) |  |
| inlinestaticprivate

Definition at line 127 of file effect_util/pin.h.

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

Referenced by findPtype().

template<Ptype PTYPE>

static void osl::effect_util::Pin::findPtype | ( | const NumEffectState & | state,
|  | Square | target,
|  | Player | attack,
|  | Player | defense,
|  | PieceMask & | result
| ) |  |
| inlinestaticprivate

Definition at line 140 of file effect_util/pin.h.

References osl::BISHOP, osl::BOOST_STATIC_ASSERT(), findOffset(), osl::PtypeTable::getEffect(), osl::EffectContent::hasBlockableEffect(), osl::Piece::isOnBoardByOwner(), osl::newPtypeO(), osl::EffectContent::offset(), osl::Ptype_Table, osl::ROOK, osl::Piece::square(), and osl::Offset::zero().

static bool osl::effect_util::Pin::hasEffectWithOffset | ( | const SimpleState & | state,
|  | Piece | attack_piece,
|  | Piece | pin,
|  | Offset | diff
| ) |  |
| inlinestaticprivate

Definition at line 116 of file effect_util/pin.h.

References osl::Piece::square().

Referenced by findOffset().

static bool osl::effect_util::Pin::hasEffectWithOffset | ( | const NumEffectState & | state,
|  | Piece | attack_piece,
|  | Piece | pin,
|  | Offset |
| ) |  |
| inlinestaticprivate

Definition at line 122 of file effect_util/pin.h.

References osl::Piece::square().

static PieceMask osl::effect_util::Pin::make | ( | const NumEffectState & | state,
|  | Square | target,
|  | Player | defense
| ) |  |
| inlinestatic

pin されている駒を計算する

Parameters

  target | 守るマス
  defense | pin されている駒の所有者

See Also
  makeByPiece, makeNaive

Definition at line 257 of file effect_util/pin.h.

References makeByPiece().

Referenced by count(), osl::state::NumEffectState::isConsistent(), and test_position().

static PieceMask osl::effect_util::Pin::make | ( | const NumEffectState & | state,
|  | Player | defense
| ) |  |
| inlinestatic

defense の王を守るために pin されている駒を計算する

Definition at line 265 of file effect_util/pin.h.

References makeByPiece().

osl::PieceMask osl::effect_util::Pin::makeByPiece | ( | const NumEffectState & | state,
|  | Square | target,
|  | Player | defense
| ) |  |
| static

飛車角は駒の位置から判断する計算方法.

See Also
  make, makeNaive

Definition at line 24 of file effect_util/pin.cc.

References osl::alt(), osl::Square::isOnBoard(), result, and target.

Referenced by make().

static PieceMask osl::effect_util::Pin::makeByPiece | ( | const NumEffectState & | state,
|  | Player | defense
| ) |  |
| inlinestatic

Definition at line 273 of file effect_util/pin.h.

References makeByPieceKing().

osl::PieceMask osl::effect_util::Pin::makeByPieceKing | ( | const NumEffectState & | state,
|  | Square | target,
|  | Player | defense
| ) |  |
| static

飛車角は駒の位置から判断, KINGに特化

See Also
  make, makeNaive

Definition at line 39 of file effect_util/pin.cc.

References osl::alt(), osl::BLACK, osl::Square::isOnBoard(), result, and target.

Referenced by makeByPiece().

osl::PieceMask osl::effect_util::Pin::makeNaive | ( | const SimpleState & | state,
|  | Square | target,
|  | Player | defense
| ) |  |
| static

8方向計算する方法

See Also
  make, makeByPiece

Definition at line 7 of file effect_util/pin.cc.

References osl::Square::isOnBoard(), result, and target.

Referenced by makeNaive().

static PieceMask osl::effect_util::Pin::makeNaive | ( | const SimpleState & | state,
|  | Player | defense
| ) |  |
| inlinestatic

Definition at line 269 of file effect_util/pin.h.

References makeNaive().

template<Player Defense>

static PieceMask osl::effect_util::Pin::makeStep | ( | const NumEffectState & | state,
|  | Square | target
| ) |  |
| inlinestatic

Definition at line 213 of file effect_util/pin.h.

References target.

static PieceMask osl::effect_util::Pin::makeStep | ( | const NumEffectState & | state,
|  | Square | target,
|  | Player | defense
| ) |  |
| inlinestatic

Definition at line 227 of file effect_util/pin.h.

References osl::BLACK, and target.

template<Player Defense>

static PieceMask osl::effect_util::Pin::makeStep1 | ( | const NumEffectState & | state,
|  | Square | target
| ) |  |
| inlinestatic

Definition at line 236 of file effect_util/pin.h.

References target.

static PieceMask osl::effect_util::Pin::makeStep1 | ( | const NumEffectState & | state,
|  | Square | target,
|  | Player | defense
| ) |  |
| inlinestatic

Definition at line 243 of file effect_util/pin.h.

References osl::BLACK, and target.

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

- effect_util/pin.h
- effect_util/pin.cc