My Project
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"
8namespace osl
9{
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:
static bool validNumber(int num)
Definition pieceTable.h:22
CArray< Ptype, Piece::SIZE > ptypes
Definition pieceTable.h:13
Ptype getPtypeOf(int num) const
Definition pieceTable.h:18
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
const PieceTable Piece_Table
Definition tables.cc:94