osl::mobility Namespace Reference

## Classes

struct | BishopMobility
| 盤上の角および馬が動けるマスの数を数える More...
class | KingMobility
struct | LanceMobility
| 盤上の香車の動けるマス More...
union | V4
class | MobilityContent
| 駒毎に指定の方向の利きを持つ最後のSquare. More...
class | MobilityTable
| 駒番号からMobilityContentを得る More...
struct | RookMobility
| 盤上の飛車および竜の動けるマス More...

## Typedefs

typedef long long v2di | __attribute__((vector_size(16)))

## Functions

template<Player P, bool All, bool Safe>
void | countMobilityBoth (const NumEffectState &state, Square pos, Offset o, int &countAll, int &countSafe)
| P : 駒pの持ち主 All : countAllを求めるかどうか?
void | countMobilityBoth (Player P, const NumEffectState &state, Square pos, Offset o, int &countAll, int &countSafe)
int | countMobilityAll (Player pl, const NumEffectState &state, Square pos, Offset o)
| 利きに関係なく動けるマスの数
int | countMobilitySafe (Player pl, const NumEffectState &state, Square pos, Offset o)
| 相手の利きがない動けるマスを求める
std::ostream & | operator<< (std::ostream &os, MobilityContent const &mc)
std::ostream & | operator<< (std::ostream &os, MobilityTable const &mt)
bool | operator== (const MobilityTable &mt1, const MobilityTable &mt2)

## Typedef Documentation

## __attribute__

typedef long long v2di osl::mobility::__attribute__((vector_size(16)))

Definition at line 22 of file kingMobility.h.

## Function Documentation

## countMobilityAll()

int osl::mobility::countMobilityAll | ( | Player | pl,
|  | const NumEffectState & | state,
|  | Square | pos,
|  | Offset | o )

inline

利きに関係なく動けるマスの数

Definition at line 44 of file countMobility.h.

References osl::BLACK, and countMobilityBoth().

## countMobilityBoth() [1/2]

template<Player P, bool All, bool Safe>

void osl::mobility::countMobilityBoth | ( | const NumEffectState & | state,
|  | Square | pos,
|  | Offset | o,
|  | int & | countAll,
|  | int & | countSafe )

inline

P : 駒pの持ち主 All : countAllを求めるかどうか?

Safe : countAllを求めるかどうか? countAll : 利きに関係なく動けるマス countSafe : 相手の利きがない動けるマス 両方を求める

Definition at line 20 of file countMobility.h.

References osl::alt(), osl::Piece::canMoveOn(), osl::NumEffectState::hasEffectAt(), osl::Square::isOnBoard(), osl::SimpleState::pieceAt(), and osl::Offset::zero().

Referenced by osl::mobility::BishopMobility::countBoth(), osl::mobility::LanceMobility::countBoth(), osl::mobility::RookMobility::countHorizontalBoth(), countMobilityAll(), countMobilityBoth(), countMobilitySafe(), and osl::mobility::RookMobility::countVerticalBoth().

## countMobilityBoth() [2/2]

void osl::mobility::countMobilityBoth | ( | Player | P,
|  | const NumEffectState & | state,
|  | Square | pos,
|  | Offset | o,
|  | int & | countAll,
|  | int & | countSafe )

inline

Definition at line 35 of file countMobility.h.

References osl::BLACK, and countMobilityBoth().

## countMobilitySafe()

int osl::mobility::countMobilitySafe | ( | Player | pl,
|  | const NumEffectState & | state,
|  | Square | pos,
|  | Offset | o )

inline

相手の利きがない動けるマスを求める

Definition at line 56 of file countMobility.h.

References osl::BLACK, and countMobilityBoth().

Referenced by osl::mobility::RookMobility::countHorizontalSafe(), osl::mobility::BishopMobility::countSafe(), osl::mobility::LanceMobility::countSafe(), and osl::mobility::RookMobility::countVerticalSafe().

## operator<<() [1/2]

std::ostream & osl::mobility::operator<< | ( | std::ostream & | os,
|  | MobilityContent const & | mc )

Definition at line 28 of file mobilityTable.cc.

References osl::mobility::MobilityContent::get().

## operator<<() [2/2]

std::ostream & osl::mobility::operator<< | ( | std::ostream & | os,
|  | MobilityTable const & | mt )

Definition at line 35 of file mobilityTable.cc.

References osl::mobility::MobilityTable::get().

## operator==()

bool osl::mobility::operator== | ( | const MobilityTable & | mt1,
|  | const MobilityTable & | mt2 )

Definition at line 49 of file mobilityTable.cc.

References osl::mobility::MobilityTable::get().