00001 /* pieceTable.h 00002 */ 00003 #ifndef OSL_PIECE_TABLE_H 00004 #define OSL_PIECE_TABLE_H 00005 00006 #include "osl/basic_type.h" 00007 #include "osl/container.h" 00008 namespace osl 00009 { 00010 class PieceTable 00011 { 00012 private: 00013 CArray<Ptype, Piece::SIZE> ptypes; 00014 template<Ptype T> 00015 void initPtype(); 00016 public: 00017 PieceTable(); 00018 Ptype getPtypeOf(int num) const{ 00019 assert(validNumber(num)); 00020 return ptypes[num]; 00021 } 00022 static bool validNumber(int num) { 00023 return 0<=num && num<=39; 00024 } 00025 }; 00026 00027 extern const PieceTable Piece_Table; 00028 } 00029 00030 #endif /* OSL_PIECE_TABLE_H */ 00031 // ;;; Local Variables: 00032 // ;;; mode:c++ 00033 // ;;; c-basic-offset:2 00034 // ;;; End: