00001 /* csaLogger.h 00002 */ 00003 #ifndef GAME_PLAYING_CSALOGGER_H 00004 #define GAME_PLAYING_CSALOGGER_H 00005 00006 #include "osl/player.h" 00007 #include <iosfwd> 00008 namespace osl 00009 { 00010 class Move; 00011 class Sennichite; 00012 namespace state 00013 { 00014 class SimpleState; 00015 } 00016 namespace game_playing 00017 { 00018 class TimeKeeper; 00019 class MoveWithComment; 00023 class CsaLogger 00024 { 00025 std::ostream& output; 00026 public: 00027 explicit CsaLogger(std::ostream& os); 00028 ~CsaLogger(); 00029 00030 void init(const char *black, const char *white, 00031 const state::SimpleState& state); 00032 00033 void pushMove(const Move& move, int seconds); 00034 void pushMove(const MoveWithComment& move, int seconds); 00035 void popMove(); 00036 void showTimeLeft(const TimeKeeper&); 00037 void writeComment(const char *comment); 00038 void resign(Player resigned); 00039 void inputError(const char *); 00040 void breakGame(); 00041 void endByRepetition(const Sennichite&); 00042 void endByDeclaration(Player declarer); 00043 private: 00044 void writeLine(const char *line); 00045 void writeWinner(Player winner); 00046 void writeCurrentDate(); 00047 }; 00048 00049 } // namespace game_playing 00050 } // namespace osl 00051 00052 #endif /* GAME_PLAYING_CSALOGGER_H */ 00053 // ;;; Local Variables: 00054 // ;;; mode:c++ 00055 // ;;; c-basic-offset:2 00056 // ;;; End: