My Project
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
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 EffectContentgetEffect (PtypeO ptypeo, Offset32 offset32) const
 
const EffectContent getEffectNotLongU (PtypeO ptypeo, Square from, Square to) const
 ptypeo が,自分から offset のところに効きを持つか? U除く
 
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 ()
 
EffectContenteffect (PtypeO ptypeo, Offset32 offset32)
 

Private Attributes

CArray< mask_t, PTYPE_SIZEnumMaskLows
 
CArray< int, PTYPE_SIZEnumIndices
 
CArray< const char *, PTYPE_SIZEnames
 
CArray< const char *, PTYPE_SIZEcsaNames
 
CArray< bool, PTYPE_SIZEbetterToPromote
 
CArray< int, PTYPE_SIZEmoveMasks
 
CArray< int, PTYPE_SIZEindexMins
 
CArray< int, PTYPE_SIZEindexLimits
 
CArray2d< int, 2, PTYPE_SIZEcanDropLimit
 
CArray2d< EffectContent, PTYPEO_SIZE, Offset32::SIZEeffectTable
 
CArray2d< EffectContent, PTYPEO_SIZE, Offset32::SIZEeffectTableNotLongU
 
CArray2d< unsigned int, 2, SHORT_DIRECTION_SIZEshortMoveMask
 

Detailed Description

Definition at line 15 of file ptypeTable.h.

Constructor & Destructor Documentation

◆ PtypeTable()

osl::PtypeTable::PtypeTable ( )

Member Function Documentation

◆ canDropTo()

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

◆ effect()

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

◆ 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

◆ getEffect() [1/2]

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

◆ getEffect() [2/2]

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

◆ 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

◆ getIndexLimit()

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

◆ getIndexMin()

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

◆ getKingIndex()

static int osl::PtypeTable::getKingIndex ( Player  p)
inlinestatic

Definition at line 98 of file ptypeTable.h.

References osl::BLACK, and osl::isValid().

◆ getMaskLow()

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

◆ getMoveMask()

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

◆ getName()

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

Definition at line 76 of file ptypeTable.h.

References names.

Referenced by osl::operator<<().

◆ 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

◆ hasUnblockableEffect()

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

Definition at line 140 of file ptypeTable.h.

References effect(), getEffect(), and osl::EffectContent::hasUnblockableEffect().

◆ init()

void osl::PtypeTable::init ( )
private

◆ initPtype()

template<osl::Ptype T>
void osl::PtypeTable::initPtype ( )
private

Definition at line 48 of file ptypeTable.cc.

◆ initPtypeSub() [1/2]

template<osl::Ptype T>
void osl::PtypeTable::initPtypeSub ( Int2Type< false >  isBasic)
private

Definition at line 39 of file ptypeTable.cc.

◆ initPtypeSub() [2/2]

template<osl::Ptype T>
void osl::PtypeTable::initPtypeSub ( Int2Type< true >  isBasic)
private

Definition at line 21 of file ptypeTable.cc.

References osl::canPromote(), osl::promote(), and osl::Square::reverseY().

◆ isBetterToPromote()

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

Member Data Documentation

◆ betterToPromote

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

Definition at line 22 of file ptypeTable.h.

Referenced by isBetterToPromote().

◆ canDropLimit

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

Definition at line 27 of file ptypeTable.h.

Referenced by getCanDropLimit().

◆ csaNames

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

Definition at line 21 of file ptypeTable.h.

Referenced by getCsaName().

◆ effectTable

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

Definition at line 29 of file ptypeTable.h.

Referenced by effect(), and getEffect().

◆ effectTableNotLongU

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

Definition at line 30 of file ptypeTable.h.

Referenced by getEffectNotLongU().

◆ indexLimits

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

Definition at line 25 of file ptypeTable.h.

Referenced by getIndexLimit().

◆ indexMins

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

Definition at line 24 of file ptypeTable.h.

Referenced by getIndexMin().

◆ moveMasks

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

Definition at line 23 of file ptypeTable.h.

Referenced by getMoveMask().

◆ names

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

Definition at line 20 of file ptypeTable.h.

Referenced by getName().

◆ numIndices

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

Definition at line 19 of file ptypeTable.h.

◆ numMaskLows

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

Definition at line 18 of file ptypeTable.h.

Referenced by getMaskLow().

◆ shortMoveMask

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

Definition at line 31 of file ptypeTable.h.

Referenced by getShortMoveMask().


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