00001 //---------------------------------------------------------------------------- 00002 /** @file HexEnvironment.hpp 00003 */ 00004 //---------------------------------------------------------------------------- 00005 00006 #ifndef HEXENVIRONMENT_HPP 00007 #define HEXENVIRONMENT_HPP 00008 00009 #include "HexBoard.hpp" 00010 #include "HexHtpEngine.hpp" 00011 00012 _BEGIN_BENZENE_NAMESPACE_ 00013 00014 //---------------------------------------------------------------------------- 00015 00016 /** Groups a HexBoard, ICEngine, and VCBuilderParam objects, 00017 which correspond to a set of parameters that can be changed. 00018 */ 00019 struct HexEnvironment 00020 { 00021 HexEnvironment(int width, int height); 00022 00023 void NewGame(int width, int height); 00024 00025 HexBoard& SyncBoard(const StoneBoard& brd); 00026 00027 ICEngine ice; 00028 00029 VCBuilderParam buildParam; 00030 00031 boost::scoped_ptr<HexBoard> brd; 00032 00033 }; 00034 00035 //---------------------------------------------------------------------------- 00036 00037 /** HTP Commands for an environment. */ 00038 class HexEnvironmentCommands 00039 { 00040 public: 00041 HexEnvironmentCommands(HexEnvironment& env); 00042 00043 ~HexEnvironmentCommands(); 00044 00045 void Register(GtpEngine& engine, const std::string name); 00046 00047 private: 00048 00049 HexEnvironment& m_env; 00050 00051 void ParamICE(HtpCommand& cmd); 00052 void ParamVC(HtpCommand& cmd); 00053 void ParamBoard(HtpCommand& board); 00054 00055 void Register(GtpEngine& engine, const std::string& command, 00056 GtpCallback<HexEnvironmentCommands>::Method method); 00057 }; 00058 00059 //---------------------------------------------------------------------------- 00060 00061 _END_BENZENE_NAMESPACE_ 00062 00063 #endif // HEXENVIRONMENT_HPP