pieceTable.h
Go to the documentation of this file.
/* pieceTable.h
*/
#ifndef OSL_PIECE_TABLE_H
#define OSL_PIECE_TABLE_H
#include "osl/basic_type.h"
#include "osl/container.h"
namespace osl
{
class PieceTable
{
private:
CArray<Ptype, Piece::SIZE> ptypes;
template<Ptype T>
void initPtype();
public:
PieceTable();
Ptype getPtypeOf(int num) const{
assert(validNumber(num));
return ptypes[num];
}
static bool validNumber(int num) {
return 0<=num && num<=39;
}
};
extern const PieceTable Piece_Table;
}
#endif /* OSL_PIECE_TABLE_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
basic_type.h
osl::CArray
Definition container.h:20
osl::PieceTable::PieceTable
PieceTable()
Definition pieceTable.cc:15
osl::PieceTable::validNumber
static bool validNumber(int num)
Definition pieceTable.h:22
osl::PieceTable::ptypes
CArray< Ptype, Piece::SIZE > ptypes
Definition pieceTable.h:13
osl::PieceTable::initPtype
void initPtype()
Definition pieceTable.cc:7
osl::PieceTable::getPtypeOf
Ptype getPtypeOf(int num) const
Definition pieceTable.h:18
container.h
osl
Definition additionalEffect.h:6
osl::Ptype
Ptype
駒の種類を4ビットでコード化する
Definition basic_type.h:84
osl::Piece_Table
const PieceTable Piece_Table
Definition tables.cc:94