pieceTable.h
Go to the documentation of this file.
1 /* pieceTable.h
2  */
3 #ifndef OSL_PIECE_TABLE_H
4 #define OSL_PIECE_TABLE_H
5 
6 #include "osl/basic_type.h"
7 #include "osl/container.h"
8 namespace osl
9 {
10  class PieceTable
11  {
12  private:
14  template<Ptype T>
15  void initPtype();
16  public:
17  PieceTable();
18  Ptype getPtypeOf(int num) const{
19  assert(validNumber(num));
20  return ptypes[num];
21  }
22  static bool validNumber(int num) {
23  return 0<=num && num<=39;
24  }
25  };
26 
27  extern const PieceTable Piece_Table;
28 }
29 
30 #endif /* OSL_PIECE_TABLE_H */
31 // ;;; Local Variables:
32 // ;;; mode:c++
33 // ;;; c-basic-offset:2
34 // ;;; End:
void initPtype()
Definition: pieceTable.cc:7
Ptype
駒の種類を4ビットでコード化する
Definition: basic_type.h:83
CArray< Ptype, Piece::SIZE > ptypes
Definition: pieceTable.h:13
const PieceTable Piece_Table
Definition: tables.cc:94
Ptype getPtypeOf(int num) const
Definition: pieceTable.h:18
static bool validNumber(int num)
Definition: pieceTable.h:22