All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
osl::effect::Liberty8Table Class Reference

Liberty8を得るために使うテーブル. More...

#include <liberty8Table.h>

Collaboration diagram for osl::effect::Liberty8Table:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Liberty8Table ()
template<Player P>
NearMask getShortMask (Ptype ptype, Square from, Square to) const
 P側のptypeのfromにある駒がtoにある Pの反対側の駒の周囲 にどういう短い利き(長い利きの隣で利きを伸ばすと8近傍内に 伸ばせる場合を除く)を持つかを返す directでなくても,targetの駒を挟んだ反対側ならOKとする 利きがあるところは0でそうでないところは1とする
template<Player P>
LongEffect8 getLongEffect (Ptype ptype, Square from, Square to) const
 P側のptypeのfromにある駒がtoにある Pの反対側の駒の周囲 にどういう長い利き(長い利きの隣で利きを伸ばすと8近傍内に 伸ばせる場合を含む)を持つかを返す
template<Player P>
LongEffect8 getLongEffect2 (Square from, Square to) const
 飛車, 龍が王の斜めの位置にいて, 両方向に長い利きを持つ場合の テーブル

Private Member Functions

LongEffect8 longEffectOf (Ptype ptype, int dx, int dy)
 黒の攻め方の駒ptype から dx, dyの位置にいる白玉の 近隣 Dir(白玉に白の目から見てDirの動き到達可能なマス) に 利きを持つ場合は dirToMask(Dir)が0, そうでない場合は1

Private Attributes

CArray< CArray< unsigned char,
Offset32::SIZE >, PTYPE_SIZE
shortMask
CArray2d< LongEffect8,
PTYPE_SIZE, Offset32::SIZE
longEffect
CArray< LongEffect8,
Offset32::SIZE
longEffect2

Detailed Description

Liberty8を得るために使うテーブル.

短い利きに関しては,ptypeと座標の差でテーブルを引けば得られる. 長い利きはgetLongEffectで得るが, 飛車に関してはそれに加えてgetLongEffect2も使う.

Definition at line 51 of file liberty8Table.h.


Constructor & Destructor Documentation


Member Function Documentation

template<Player P>
LongEffect8 osl::effect::Liberty8Table::getLongEffect ( Ptype  ptype,
Square  from,
Square  to 
) const [inline]

P側のptypeのfromにある駒がtoにある Pの反対側の駒の周囲 にどういう長い利き(長い利きの隣で利きを伸ばすと8近傍内に 伸ばせる場合を含む)を持つかを返す

Definition at line 77 of file liberty8Table.h.

References osl::PtypeTable::hasLongMove(), osl::Square::isOnBoard(), osl::isValid(), longEffect, and osl::Ptype_Table.

template<Player P>
LongEffect8 osl::effect::Liberty8Table::getLongEffect2 ( Square  from,
Square  to 
) const [inline]

飛車, 龍が王の斜めの位置にいて, 両方向に長い利きを持つ場合の テーブル

Definition at line 88 of file liberty8Table.h.

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

template<Player P>
NearMask osl::effect::Liberty8Table::getShortMask ( Ptype  ptype,
Square  from,
Square  to 
) const [inline]

P側のptypeのfromにある駒がtoにある Pの反対側の駒の周囲 にどういう短い利き(長い利きの隣で利きを伸ばすと8近傍内に 伸ばせる場合を除く)を持つかを返す directでなくても,targetの駒を挟んだ反対側ならOKとする 利きがあるところは0でそうでないところは1とする

Definition at line 66 of file liberty8Table.h.

References osl::Square::isOnBoard(), osl::isValid(), and shortMask.

LongEffect8 osl::effect::Liberty8Table::longEffectOf ( Ptype  ptype,
int  dx,
int  dy 
) [private]

黒の攻め方の駒ptype から dx, dyの位置にいる白玉の 近隣 Dir(白玉に白の目から見てDirの動き到達可能なマス) に 利きを持つ場合は dirToMask(Dir)が0, そうでない場合は1

自分が動いて元のマスに利きをつける手は生成しない

Definition at line 91 of file liberty8Table.cc.

References osl::Board_Table, osl::effect::directionOf(), osl::BoardTable::getDxForBlack(), osl::BoardTable::getDyForBlack(), osl::effect::hasLongMove(), osl::PtypeTable::hasLongMove(), osl::Offset32Base< Width, Width2 >::index(), longEffect2, osl::PROOK, osl::Ptype_Table, osl::ROOK, osl::effect::LongEffect8::setMask(), osl::effect::LongEffect8::setOffset(), and osl::Offset::ZERO().

Referenced by Liberty8Table().


Member Data Documentation

Definition at line 53 of file liberty8Table.h.

Referenced by getLongEffect(), and Liberty8Table().

Definition at line 54 of file liberty8Table.h.

Referenced by getLongEffect2(), and longEffectOf().

CArray<CArray<unsigned char,Offset32::SIZE>,PTYPE_SIZE> osl::effect::Liberty8Table::shortMask [private]

Definition at line 52 of file liberty8Table.h.

Referenced by getShortMask(), and Liberty8Table().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines