openingBookConverter.h
Go to the documentation of this file.
00001 #ifndef _OPENING_BOOK_CONVERTER_H
00002 #define _OPENING_BOOK_CONVERTER_H
00003 
00004 #include <osl/record/opening/openingBook.h>
00005 
00006 class OBState
00007 {
00008   int OBMoveIndex;
00009   int nOBMove;
00010   int blackWinCount;
00011   int whiteWinCount;
00012 
00013  public:
00014   OBState(int startIndex, int nMove, int blackWin, int whiteWin) :
00015     OBMoveIndex(startIndex), nOBMove(nMove),
00016     blackWinCount(blackWin), whiteWinCount(whiteWin) {}
00017     int getOBMoveIndex() const { return OBMoveIndex; }
00018     int getNOBMove() const { return nOBMove; }
00019     int getBlackWinCount() const { return blackWinCount; }
00020     int getWhiteWinCount() const { return whiteWinCount; }
00021 };
00022 
00023 class OpeningBookConverter
00024 {
00025   osl::vector<OBState> states;
00026   osl::vector<osl::record::opening::OBMove> moves;
00027  public:
00028   OpeningBookConverter(const char* filename);
00029   ~OpeningBookConverter() {};
00030   void write(const char* filename);
00031   void writeInNewFormat(const char* filename);
00032   void writeInNewEditFormat(const char* filename);
00033  private:
00034   int readInt(std::ifstream& ifs);
00035   void writeInt(std::ofstream& ofs, int n);
00036   void writeInNewFormat(std::ofstream& ofs);
00037 };
00038 
00039 #endif // _OPENING_BOOK_CONVERTER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines