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_COACH_CLANG_MANAGER_H
00033 #define RCSC_COACH_CLANG_MANAGER_H
00034
00035 #include <rcsc/game_time.h>
00036 #include <rcsc/types.h>
00037
00038 #include <string>
00039 #include <utility>
00040
00045 class CLangManager {
00046 private:
00047
00048 CLangManager( const CLangManager & );
00049
00050 CLangManager & operator=( const CLangManager & );
00051
00052 static const int DEFAULT_CLANG_MIN_VER;
00053 static const int DEFAULT_CLANG_MAX_VER;
00054
00055
00056 int M_clang_min_ver;
00057 int M_clang_max_ver;
00058
00060 std::pair< int, int > M_teammate_clang_ver[11];
00061
00062
00063 GameTime M_last_define_time;
00064 GameTime M_last_meta_time;
00065 GameTime M_last_advice_time;
00066 GameTime M_last_info_time;
00067 GameTime M_last_delete_time;
00068 GameTime M_last_rule_time;
00069
00071 int M_freeform_count;
00072
00073 public:
00077 CLangManager();
00078
00079
00080
00085 void parseCLangVer( const char * msg );
00086
00091 void updateDefineTime( const GameTime & t )
00092 {
00093 M_last_define_time = t;
00094 }
00095
00100 void updateMetaTime( const GameTime & t )
00101 {
00102 M_last_meta_time = t;
00103 }
00104
00109 void updateAdviceTime( const GameTime & t )
00110 {
00111 M_last_advice_time = t;
00112 }
00113
00118 void updateInfoTime( const GameTime & t )
00119 {
00120 M_last_advice_time = t;
00121 }
00122
00127 void updateDeleteTime( const GameTime & t )
00128 {
00129 M_last_delete_time = t;
00130 }
00131
00136 void updateRuleTime( const GameTime & t )
00137 {
00138 M_last_rule_time = t;
00139 }
00140
00144 void incFreeFormCount()
00145 {
00146 ++M_freeform_count;
00147 }
00148
00152 void resetFreeFormCount()
00153 {
00154 M_freeform_count = 0;
00155 }
00156
00157
00158
00163 int minVersion() const
00164 {
00165 return M_clang_min_ver;
00166 }
00167
00172 int maxVersion() const
00173 {
00174 return M_clang_min_ver;
00175 }
00176
00181 const
00182 GameTime & lastDefineTime() const
00183 {
00184 return M_last_define_time;
00185 }
00186
00191 const
00192 GameTime & lastMetaTime() const
00193 {
00194 return M_last_meta_time;
00195 }
00196
00201 const
00202 GameTime & lastAdviceTime() const
00203 {
00204 return M_last_advice_time;
00205 }
00206
00211 const
00212 GameTime & lastInfoTime() const
00213 {
00214 return M_last_info_time;
00215 }
00216
00221 int freeFormCount() const
00222 {
00223 return M_freeform_count;
00224 }
00225 };
00226
00227 #endif