00001 //---------------------------------------------------------------------------- 00002 /** @file GoSafetyCommands.h */ 00003 //---------------------------------------------------------------------------- 00004 00005 #ifndef GO_SAFETYCOMMANDS_H 00006 #define GO_SAFETYCOMMANDS_H 00007 00008 #include <string> 00009 #include "GtpEngine.h" 00010 #include "SgBWSet.h" 00011 00012 class GoBoard; 00013 00014 //---------------------------------------------------------------------------- 00015 00016 /** GTP commands related to safety solvers. */ 00017 class GoSafetyCommands 00018 { 00019 public: 00020 /** Constructor. 00021 @param bd The game board. */ 00022 GoSafetyCommands(const GoBoard& bd); 00023 00024 void AddGoGuiAnalyzeCommands(GtpCommand& cmd); 00025 00026 /** @page gosafetycommands GoSafetyCommands Commands 00027 - @link CmdDameStatic() @c go_safe_dame_static @endlink 00028 - @link CmdGfx() @c go_safe_gfx @endlink 00029 - @link CmdSafe() @c go_safe @endlink 00030 - @link CmdWinner() @c go_safe_winner @endlink */ 00031 /** @name Command Callbacks */ 00032 // @{ 00033 // The callback functions are documented in the cpp file 00034 void CmdDameStatic(GtpCommand& cmd); 00035 void CmdGfx(GtpCommand& cmd); 00036 void CmdSafe(GtpCommand& cmd); 00037 void CmdWinner(GtpCommand& cmd); 00038 // @} // @name 00039 00040 void Register(GtpEngine& engine); 00041 00042 private: 00043 const GoBoard& m_bd; 00044 00045 SgBWSet GetSafe(int& totalRegions, const std::string& type); 00046 00047 void Register(GtpEngine& e, const std::string& command, 00048 GtpCallback<GoSafetyCommands>::Method method); 00049 }; 00050 00051 //---------------------------------------------------------------------------- 00052 00053 #endif // GO_SAFETYCOMMANDS_H