00001
00002
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00031
00032 #ifndef RCSC_RCG_HANDLER_H
00033 #define RCSC_RCG_HANDLER_H
00034
00035 #include <rcsc/rcg/types.h>
00036
00037 #include <string>
00038
00039 namespace rcsc {
00040 namespace rcg {
00041
00048 class Handler {
00049 private:
00051 int M_log_version;
00052
00053 public:
00057 Handler()
00058 : M_log_version( 0 )
00059 { }
00060
00064 virtual
00065 ~Handler()
00066 { }
00067
00076 virtual
00077 bool handleLogVersion( const int ver )
00078 {
00079 M_log_version = ver;
00080 return true;
00081 }
00082
00090 virtual
00091 int logVersion() const
00092 {
00093 return M_log_version;
00094 }
00095
00101 virtual
00102 bool handleDispInfo( const dispinfo_t & info ) = 0;
00103
00109 virtual
00110 bool handleShowInfo( const showinfo_t & info ) = 0;
00111
00117 virtual
00118 bool handleShortShowInfo2( const short_showinfo_t2 & info ) = 0;
00119
00121
00127 virtual
00128 bool handleMsgInfo( Int16 board,
00129 const std::string & msg ) = 0;
00130
00136 virtual
00137 bool handlePlayMode( char playmode ) = 0;
00138
00145 virtual
00146 bool handleTeamInfo( const team_t & team_left,
00147 const team_t & team_right ) = 0;
00148
00154 virtual
00155 bool handlePlayerType( const player_type_t & type ) = 0;
00156
00162 virtual
00163 bool handleServerParam( const server_params_t & param ) = 0;
00164
00170 virtual
00171 bool handlePlayerParam( const player_params_t & param ) = 0;
00172
00177 virtual
00178 bool handleEOF() = 0;
00179
00180
00181
00182
00183
00184
00191 virtual
00192 bool handleShow( const int time,
00193 const ShowInfoT & show ) = 0;
00194
00202 virtual
00203 bool handleMsg( const int time,
00204 const int board,
00205 const std::string & msg ) = 0;
00206
00213 virtual
00214 bool handlePlayMode( const int time,
00215 const PlayMode pm ) = 0;
00216
00224 virtual
00225 bool handleTeam( const int time,
00226 const TeamT & team_l,
00227 const TeamT & team_r ) = 0;
00228
00234 virtual
00235 bool handleServerParam( const std::string & msg ) = 0;
00236
00242 virtual
00243 bool handlePlayerParam( const std::string & msg ) = 0;
00244
00250 virtual
00251 bool handlePlayerType( const std::string & msg ) = 0;
00252
00253 };
00254
00255
00256 }
00257 }
00258
00259 #endif