clang_manager.h

説明を見る。
00001 // -*-c++-*-
00002 
00008 /*
00009  *Copyright:
00010 
00011  Copyright (C) Hidehisa AKIYAMA
00012 
00013  This code is free software; you can redistribute it and/or
00014  modify it under the terms of the GNU Lesser General Public
00015  License as published by the Free Software Foundation; either
00016  version 2.1 of the License, or (at your option) any later version.
00017 
00018  This library is distributed in the hope that it will be useful,
00019  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021  Lesser General Public License for more details.
00022 
00023  You should have received a copy of the GNU Lesser General Public
00024  License along with this library; if not, write to the Free Software
00025  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026 
00027  *EndCopyright:
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     // not used
00048     CLangManager( const CLangManager & );
00049     // not used
00050     CLangManager & operator=( const CLangManager & );
00051 
00052     static const int DEFAULT_CLANG_MIN_VER; 
00053     static const int DEFAULT_CLANG_MAX_VER; 
00054 
00055     // team's acceptable clang version
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     // last clang sent time
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     // setter
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     // getter
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

librcscに対してThu May 1 15:41:20 2008に生成されました。  doxygen 1.5.0