osl::PtypeTable Class Reference

`#include <ptypeTable.h>`

## Public Member Functions

| PtypeTable ()
unsigned int | getShortMoveMask (Player p, PtypeO ptypeo, Direction dir) const
mask_t | getMaskLow (Ptype ptype) const
int | getIndex (Ptype) const
bool | hasLongMove (Ptype ptype) const
| 遅くて良い?
bool | isBetterToPromote (Ptype ptype) const
int | getCanDropLimit (Player player, Ptype ptype) const
bool | canDropTo (Player pl, Ptype ptype, Square pos) const
const char * | getName (Ptype ptype) const
const char * | getCsaName (Ptype ptype) const
int | getMoveMask (Ptype ptype) const
int | getIndexMin (Ptype ptype) const
int | getIndexLimit (Ptype ptype) const
const EffectContent | getEffect (PtypeO ptypeo, Square from, Square to) const
| fromにいるptypeoがtoに利きを持つか?
const EffectContent & | getEffect (PtypeO ptypeo, Offset32 offset32) const
const EffectContent | getEffectNotLongU (PtypeO ptypeo, Square from, Square to) const
| ptypeo が，自分から offset のところに効きを持つか?
bool | hasUnblockableEffect (PtypeO attacker, Square from, Square to) const

## Static Public Member Functions

static int | getKingIndex (Player p)

## Private Member Functions

template<Ptype T>
void | initPtypeSub (Int2Type< false > isBasic)
template<Ptype T>
void | initPtypeSub (Int2Type< true > isBasic)
template<Ptype T>
void | initPtype ()
void | init ()
EffectContent & | effect (PtypeO ptypeo, Offset32 offset32)

## Private Attributes

CArray< mask_t, PTYPE_SIZE > | numMaskLows
CArray< int, PTYPE_SIZE > | numIndices
CArray< const char *, PTYPE_SIZE > | names
CArray< const char *, PTYPE_SIZE > | csaNames
CArray< bool, PTYPE_SIZE > | betterToPromote
CArray< int, PTYPE_SIZE > | moveMasks
CArray< int, PTYPE_SIZE > | indexMins
CArray< int, PTYPE_SIZE > | indexLimits
CArray2d< int, 2, PTYPE_SIZE > | canDropLimit
CArray2d< EffectContent, PTYPEO_SIZE, Offset32::SIZE > | effectTable
CArray2d< EffectContent, PTYPEO_SIZE, Offset32::SIZE > | effectTableNotLongU
CArray2d< unsigned int, 2, SHORT_DIRECTION_SIZE > | shortMoveMask

## Detailed Description

Definition at line 15 of file ptypeTable.h.

## Constructor & Destructor Documentation

## PtypeTable()

osl::PtypeTable::PtypeTable | ( |  | ) |

Definition at line 6 of file ptypeTable.cc.

References osl::BLACK, osl::EffectContent::DIRECT(), effect(), getEffect(), init(), osl::newPtypeO(), osl::PPAWN, osl::ROOK, and osl::WHITE.

## Member Function Documentation

## canDropTo()

bool osl::PtypeTable::canDropTo | ( | Player | pl,
|  | Ptype | ptype,
|  | Square | pos ) const

inline

Definition at line 68 of file ptypeTable.h.

References osl::BLACK, getCanDropLimit(), osl::WHITE, and osl::Square::y().

## effect()

EffectContent & osl::PtypeTable::effect | ( | PtypeO | ptypeo,
|  | Offset32 | offset32 )

inline private

Definition at line 123 of file ptypeTable.h.

References effectTable, osl::Offset32Base< Width, Width2 >::index(), osl::isValidPtypeO(), and osl::PTYPEO_MIN.

Referenced by hasUnblockableEffect(), init(), and PtypeTable().

## getCanDropLimit()

int osl::PtypeTable::getCanDropLimit | ( | Player | player,
|  | Ptype | ptype ) const

inline

Definition at line 62 of file ptypeTable.h.

References canDropLimit, osl::isPromoted(), osl::isValid(), and osl::playerToIndex().

Referenced by canDropTo().

## getCsaName()

const char * osl::PtypeTable::getCsaName | ( | Ptype | ptype | ) | const

inline

Definition at line 80 of file ptypeTable.h.

References csaNames.

## getEffect() [1/2]

const EffectContent & osl::PtypeTable::getEffect | ( | PtypeO | ptypeo,
|  | Offset32 | offset32 ) const

inline

Definition at line 117 of file ptypeTable.h.

References effectTable, osl::Offset32Base< Width, Width2 >::index(), osl::isValidPtypeO(), and osl::PTYPEO_MIN.

## getEffect() [2/2]

const EffectContent osl::PtypeTable::getEffect | ( | PtypeO | ptypeo,
|  | Square | from,
|  | Square | to ) const

inline

fromにいるptypeoがtoに利きを持つか?

Parameters

  ptypeo | - 駒の種類
  from | - 駒の位置
  to | - 利きをチェックするマスの位置

Definition at line 112 of file ptypeTable.h.

References getEffect(), and osl::Square::isOnBoard().

Referenced by getEffect(), hasUnblockableEffect(), init(), and PtypeTable().

## getEffectNotLongU()

const EffectContent osl::PtypeTable::getEffectNotLongU | ( | PtypeO | ptypeo,
|  | Square | from,
|  | Square | to ) const

inline

ptypeo が，自分から offset のところに効きを持つか?

U除く

Definition at line 133 of file ptypeTable.h.

References effectTableNotLongU, osl::Offset32Base< Width, Width2 >::index(), osl::Square::isOnBoard(), osl::isValidPtypeO(), and osl::PTYPEO_MIN.

## getIndex()

int osl::PtypeTable::getIndex | ( | Ptype |  | ) | const

inline

Definition at line 50 of file ptypeTable.h.

## getIndexLimit()

int osl::PtypeTable::getIndexLimit | ( | Ptype | ptype | ) | const

inline

Definition at line 93 of file ptypeTable.h.

References indexLimits, and osl::isBasic().

## getIndexMin()

int osl::PtypeTable::getIndexMin | ( | Ptype | ptype | ) | const

inline

Definition at line 88 of file ptypeTable.h.

References indexMins, and osl::isBasic().

Referenced by hasLongMove().

## getKingIndex()

int osl::PtypeTable::getKingIndex | ( | Player | p | ) |

inline static

Definition at line 98 of file ptypeTable.h.

References osl::BLACK, osl::KingTraits< T >::index, and osl::isValid().

## getMaskLow()

mask_t osl::PtypeTable::getMaskLow | ( | Ptype | ptype | ) | const

inline

Definition at line 46 of file ptypeTable.h.

References numMaskLows.

## getMoveMask()

int osl::PtypeTable::getMoveMask | ( | Ptype | ptype | ) | const

inline

Definition at line 84 of file ptypeTable.h.

References moveMasks.

## getName()

const char * osl::PtypeTable::getName | ( | Ptype | ptype | ) | const

inline

Definition at line 76 of file ptypeTable.h.

References names.

## getShortMoveMask()

unsigned int osl::PtypeTable::getShortMoveMask | ( | Player | p,
|  | PtypeO | ptypeo,
|  | Direction | dir ) const

inline

Definition at line 41 of file ptypeTable.h.

References osl::playerToIndex(), osl::PTYPEO_MIN, and shortMoveMask.

## hasLongMove()

bool osl::PtypeTable::hasLongMove | ( | Ptype | ptype | ) | const

inline

遅くて良い?

Definition at line 54 of file ptypeTable.h.

References getIndexMin(), and osl::unpromote().

## hasUnblockableEffect()

bool osl::PtypeTable::hasUnblockableEffect | ( | PtypeO | attacker,
|  | Square | from,
|  | Square | to ) const

inline

Definition at line 140 of file ptypeTable.h.

References effect(), and getEffect().

## init()

void osl::PtypeTable::init | ( |  | ) |

private

Definition at line 53 of file ptypeTable.cc.

References osl::BLACK, osl::Board_Table, osl::EffectContent::DIRECT(), osl::DIRECTION_MAX, osl::DIRECTION_MIN, effect(), effectTable, effectTableNotLongU, getEffect(), osl::Offset32Base< Width, Width2 >::index(), initPtype(), osl::isLong(), osl::LONG_U, moveMasks, osl::newOffset(), osl::newPtypeO(), numIndices, numMaskLows, osl::PTYPE_MAX, osl::PTYPE_MIN, osl::PTYPEO_MIN, osl::ROOK, shortMoveMask, and osl::WHITE.

Referenced by PtypeTable().

## initPtype()

template<osl::Ptype T>

void osl::PtypeTable::initPtype | ( |  | ) |

private

Definition at line 48 of file ptypeTable.cc.

References initPtypeSub().

Referenced by init().

## initPtypeSub() [1/2]

template<osl::Ptype T>

void osl::PtypeTable::initPtypeSub | ( | Int2Type< false > | isBasic | ) |

private

Definition at line 39 of file ptypeTable.cc.

References betterToPromote, csaNames, moveMasks, and names.

Referenced by initPtype(), and initPtypeSub().

## initPtypeSub() [2/2]

template<osl::Ptype T>

void osl::PtypeTable::initPtypeSub | ( | Int2Type< true > | isBasic | ) |

private

黒

白

Definition at line 21 of file ptypeTable.cc.

References canDropLimit, osl::canPromote(), indexLimits, osl::PtypeFuns< T >::indexMask, indexMins, initPtypeSub(), osl::misc::GeneralMask< mask_int_t >::makeDirect(), numIndices, numMaskLows, osl::promote(), and osl::Square::reverseY().

## isBetterToPromote()

bool osl::PtypeTable::isBetterToPromote | ( | Ptype | ptype | ) | const

inline

Definition at line 58 of file ptypeTable.h.

References betterToPromote.

## Member Data Documentation

## betterToPromote

CArray<bool, PTYPE_SIZE> osl::PtypeTable::betterToPromote

private

Definition at line 22 of file ptypeTable.h.

Referenced by initPtypeSub(), and isBetterToPromote().

## canDropLimit

CArray2d<int, 2, PTYPE_SIZE> osl::PtypeTable::canDropLimit

private

Definition at line 27 of file ptypeTable.h.

Referenced by getCanDropLimit(), and initPtypeSub().

## csaNames

CArray<const char *, PTYPE_SIZE> osl::PtypeTable::csaNames

private

Definition at line 21 of file ptypeTable.h.

Referenced by getCsaName(), and initPtypeSub().

## effectTable

CArray2d<EffectContent,PTYPEO_SIZE,Offset32::SIZE> osl::PtypeTable::effectTable

private

Definition at line 29 of file ptypeTable.h.

Referenced by effect(), getEffect(), and init().

## effectTableNotLongU

CArray2d<EffectContent,PTYPEO_SIZE,Offset32::SIZE> osl::PtypeTable::effectTableNotLongU

private

Definition at line 30 of file ptypeTable.h.

Referenced by getEffectNotLongU(), and init().

## indexLimits

CArray<int, PTYPE_SIZE> osl::PtypeTable::indexLimits

private

Definition at line 25 of file ptypeTable.h.

Referenced by getIndexLimit(), and initPtypeSub().

## indexMins

CArray<int, PTYPE_SIZE> osl::PtypeTable::indexMins

private

Definition at line 24 of file ptypeTable.h.

Referenced by getIndexMin(), and initPtypeSub().

## moveMasks

CArray<int, PTYPE_SIZE> osl::PtypeTable::moveMasks

private

Definition at line 23 of file ptypeTable.h.

Referenced by getMoveMask(), init(), and initPtypeSub().

## names

CArray<const char *, PTYPE_SIZE> osl::PtypeTable::names

private

Definition at line 20 of file ptypeTable.h.

Referenced by getName(), and initPtypeSub().

## numIndices

CArray<int, PTYPE_SIZE> osl::PtypeTable::numIndices

private

Definition at line 19 of file ptypeTable.h.

Referenced by init(), and initPtypeSub().

## numMaskLows

CArray<mask_t, PTYPE_SIZE> osl::PtypeTable::numMaskLows

private

Definition at line 18 of file ptypeTable.h.

Referenced by getMaskLow(), init(), and initPtypeSub().

## shortMoveMask

CArray2d<unsigned int, 2, SHORT_DIRECTION_SIZE> osl::PtypeTable::shortMoveMask

private

Definition at line 31 of file ptypeTable.h.

Referenced by getShortMoveMask(), and init().

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

- ptypeTable.h
- ptypeTable.cc