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

あるマスの10近傍(8近傍+桂馬の利き)の駒の有無を表すbitset. More...

#include <nearMask.h>

Public Member Functions

 NearMask ()
 
NearMaskoperator|= (NearMask r)
 
NearMaskoperator&= (NearMask r)
 
unsigned int spaceMask () const
 
bool isSet (int n) const
 
int takeOneBit ()
 on の bit を一つoffにし,そのindexを返す More...
 
bool any () const
 
unsigned int uintValue () const
 

Static Public Member Functions

static const NearMask makeDirect (unsigned int value)
 
template<Player P, Direction Dir>
static const NearMask make (NumEffectState const &state, Square target)
 あるマスに,利きをつけようとする場合に, 10近傍の状態を返す More...
 
template<Player P>
static const NearMask make (NumEffectState const &state, Square target)
 

Private Member Functions

 NearMask (unsigned int value)
 

Private Attributes

unsigned int mask
 

Detailed Description

あるマスの10近傍(8近傍+桂馬の利き)の駒の有無を表すbitset.

手番の側からの固定視点 0-9 bit - Direction(UL=0, .., UUR=9)に対応するマスが空白または敵駒の時に1 16-25 bit - Direction+16(UL=16, .., UUR=25)に対応するマスが空白の時に1 先手番で,マス(3,3)に注目している時に,ULに対応するマスは,(4,2)ではなく (2,4)を指す.(2,4)にULの利きを持つ味方の駒を置くと(3,3)を攻撃できるから

Definition at line 20 of file nearMask.h.

Constructor & Destructor Documentation

osl::container::NearMask::NearMask ( unsigned int  value)
inlineexplicitprivate

Definition at line 23 of file nearMask.h.

osl::container::NearMask::NearMask ( )
inline

Definition at line 25 of file nearMask.h.

Referenced by make(), and makeDirect().

Member Function Documentation

bool osl::container::NearMask::any ( ) const
inline

Definition at line 87 of file nearMask.h.

References mask.

bool osl::container::NearMask::isSet ( int  n) const
inline

Definition at line 76 of file nearMask.h.

References mask.

template<Player P, Direction Dir>
static const NearMask osl::container::NearMask::make ( NumEffectState const &  state,
Square  target 
)
inlinestatic

あるマスに,利きをつけようとする場合に, 10近傍の状態を返す

Parameters
P(template)- 攻撃側のプレイヤー
Dir(template)- この向きの利きをつける場合のマス
state- 盤面を表す
target- 利きをつけられるマス
Returns
下位16ビット(中の10ビット)は空白または敵駒の時に1,それ以外で0 上位16ビット(中の10ビット) は空白の時に1, それ以外で0

攻撃する側のマス

Definition at line 40 of file nearMask.h.

References osl::Piece::canMoveOn(), osl::Piece::isEmpty(), and NearMask().

template<Player P>
static const NearMask osl::container::NearMask::make ( NumEffectState const &  state,
Square  target 
)
inlinestatic

10近傍の駒の状態をチェック NOTE: Stateがsignature effectの時には特殊化した高速バージョンを 作成すべし

Definition at line 52 of file nearMask.h.

References target.

static const NearMask osl::container::NearMask::makeDirect ( unsigned int  value)
inlinestatic

Definition at line 26 of file nearMask.h.

References NearMask().

NearMask& osl::container::NearMask::operator&= ( NearMask  r)
inline

Definition at line 73 of file nearMask.h.

References mask.

NearMask& osl::container::NearMask::operator|= ( NearMask  r)
inline

Definition at line 72 of file nearMask.h.

References mask.

unsigned int osl::container::NearMask::spaceMask ( ) const
inline

Definition at line 75 of file nearMask.h.

References mask.

int osl::container::NearMask::takeOneBit ( )
inline

on の bit を一つoffにし,そのindexを返す

Definition at line 83 of file nearMask.h.

References mask, and osl::misc::BitOp::takeOneBit().

unsigned int osl::container::NearMask::uintValue ( ) const
inline

Definition at line 88 of file nearMask.h.

References mask.

Referenced by osl::container::operator<(), osl::container::operator<<(), and osl::container::operator==().

Member Data Documentation

unsigned int osl::container::NearMask::mask
private

Definition at line 22 of file nearMask.h.

Referenced by any(), isSet(), operator&=(), operator|=(), spaceMask(), takeOneBit(), and uintValue().


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