My Project
immediateCheckmateTable.h
Go to the documentation of this file.
1/* immediateCheckmateTable.h
2 */
3#ifndef OSL_CHECKMATE_IMMEDIATE_CHECKMATE_TABLE_H
4#define OSL_CHECKMATE_IMMEDIATE_CHECKMATE_TABLE_H
5#include "osl/basic_type.h"
7
8namespace osl
9{
10 namespace checkmate
11 {
13 {
14 private:
19 public:
21 unsigned char dropPtypeMaskOf(unsigned int liberty_drop_mask) const
22 {
23 return dropPtypeMasks[liberty_drop_mask];
24 }
25 unsigned char dropPtypeMask(King8Info canMoveMask) const
26 {
27 return dropPtypeMaskOf(canMoveMask.libertyDropMask());
28 }
29 unsigned int ptypeDropMask(Ptype ptype,King8Info canMoveMask) const
30 {
31 return ptypeDropMasks[canMoveMask.liberty()][ptype];
32 }
33 unsigned int blockingMask(Ptype ptype,Direction dir) const
34 {
35 assert(static_cast<int>(dir)<8);
36 return blockingMasks[ptype][dir];
37 }
38 unsigned int noEffectMask(Ptype ptype,Direction dir) const
39 {
40 assert(static_cast<int>(dir)<8);
41 return noEffectMasks[ptype][dir];
42 }
43 };
45 }
46}
47
48#endif /* OSL_CHECKMATE_IMMEDIATE_CHECKMATE_TABLE_H */
49// ;;; Local Variables:
50// ;;; mode:c++
51// ;;; c-basic-offset:2
52// ;;; End:
53
CArray2d< unsigned short, PTYPE_SIZE, 8 > noEffectMasks
CArray< unsigned char, 0x10000u > dropPtypeMasks
unsigned int ptypeDropMask(Ptype ptype, King8Info canMoveMask) const
CArray2d< unsigned char, 0x100u, PTYPE_SIZE > ptypeDropMasks
unsigned char dropPtypeMaskOf(unsigned int liberty_drop_mask) const
CArray2d< unsigned char, PTYPE_SIZE, 8 > blockingMasks
unsigned int blockingMask(Ptype ptype, Direction dir) const
unsigned char dropPtypeMask(King8Info canMoveMask) const
unsigned int noEffectMask(Ptype ptype, Direction dir) const
敵玉の8近傍の状態を表す.
Definition king8Info.h:29
unsigned int liberty() const
8-15 bit 目を 0-7bitにshiftして返す
Definition king8Info.h:54
unsigned int libertyDropMask() const
0-15bit
Definition king8Info.h:59
const ImmediateCheckmateTable Immediate_Checkmate_Table
Definition tables.cc:122
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
Direction
Definition basic_type.h:310