00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef CLIENTAPP_H_
00014 # define CLIENTAPP_H_
00015
00016 # include "xml/xml_config.hh"
00017 # include "ClientCx.hh"
00018 # include "RulesLoader.hh"
00019
00020 class BaseCRules;
00021
00028 class ClientApp
00029 {
00030 public:
00036 ClientApp(int argc, char** argv, const std::string& cfg_def_file, const std::string& cfg_def_loc);
00037 virtual ~ClientApp();
00038
00040 int runApp();
00041
00043 int runChampion();
00044
00045 private:
00046 Log log_client_;
00047
00048 protected:
00049 virtual void showHelp(const char* prgname);
00050 virtual void showVersion();
00051 virtual int showMenu();
00052 virtual int onPlay(bool replay) = 0;
00053
00054 xml::XMLConfig cfg_;
00055 BaseCRules* rules_;
00056 ClientCx ccx_;
00057 RulesLoader rules_loader_;
00058
00059 private:
00060 void parseOption();
00061 void parseConfig();
00062 void setOpt();
00063
00064 int argc_;
00065 char** argv_;
00066
00067 char* config_file_;
00068 int client_gid_;
00069 };
00070
00071 #endif