My Project
effectedNumTable.h
Go to the documentation of this file.
1 #ifndef _EFFECTED_NUM_TABLE_H
2 #define _EFFECTED_NUM_TABLE_H
3 #include "osl/simpleState.h"
4 #include <iosfwd>
5 namespace osl
6 {
7  namespace effect
8  {
9  union Byte8 {
10  unsigned long long lv;
12  }
13 #ifdef __GNUC__
14  __attribute__((aligned(8)))
15 #endif
16  ;
24  {
25  private:
27  public:
28  EffectedNum() { clear(); }
29  void clear(){
30 #define E(n) ((static_cast<unsigned long long>(EMPTY_NUM)<<((n)*8)))
31  b8.lv= E(0)|E(1)|E(2)|E(3)|E(4)|E(5)|E(6)|E(7);
32 #undef E
33  }
34  int operator[](Direction d) const{
35  assert(0<=d && d<=7);
36  return b8.uc[d];
37  }
38  unsigned char& operator[](Direction d){
39  assert(0<=d && d<=7);
40  return b8.uc[d];
41  }
42  };
44  {
46 #ifdef __GNUC__
47  __attribute__((aligned(16)))
48 #endif
49  ;
50  public:
53  const EffectedNum& operator[](int i) const {
54  return contents[i];
55  }
56  void clear();
58  return contents[i];
59  }
60  };
61  bool operator==(const EffectedNumTable&,const EffectedNumTable&);
62  std::ostream& operator<<(std::ostream&,const EffectedNumTable&);
63  }
64  using effect::EffectedNumTable;
65 }
66 
67 #endif // _EFFECTED_NUM_TABLE_H
68 // ;;; Local Variables:
69 // ;;; mode:c++
70 // ;;; c-basic-offset:2
71 // ;;; End:
const EffectedNum & operator[](int i) const
CArray< EffectedNum, 40 > contents
EffectedNum & operator[](int i)
盤面上の駒が「黒から見た」方向に長い利きをつけられている時に, 利きをつけている駒の番号を得る たとえば,Uの時は下から上方向の長い利きがついているものとする. その方向の利きがついていない場合はEMP...
unsigned char & operator[](Direction d)
int operator[](Direction d) const
#define E(n)
std::ostream & operator<<(std::ostream &, const EffectedNumTable &)
bool operator==(const EffectedNumTable &, const EffectedNumTable &)
Direction
Definition: basic_type.h:310
const PtypeO PTYPEO_EDGE __attribute__((unused))
CArray< unsigned char, 8 > uc
unsigned long long lv