GTP commands related to safety solvers. More...
#include <GoSafetyCommands.h>
Public Member Functions | |
GoSafetyCommands (const GoBoard &bd) | |
Constructor. | |
void | AddGoGuiAnalyzeCommands (GtpCommand &cmd) |
void | Register (GtpEngine &engine) |
Command Callbacks | |
void | CmdDameStatic (GtpCommand &cmd) |
Return dame points after running static safety algorithm. | |
void | CmdGfx (GtpCommand &cmd) |
Information about safe points optimized for graphical display in GoGui. | |
void | CmdSafe (GtpCommand &cmd) |
List of safe points. | |
void | CmdWinner (GtpCommand &cmd) |
Private Member Functions | |
SgBWSet | GetSafe (int &totalRegions, const std::string &type) |
void | Register (GtpEngine &e, const std::string &command, GtpCallback< GoSafetyCommands >::Method method) |
Private Attributes | |
const GoBoard & | m_bd |
GTP commands related to safety solvers.
Definition at line 17 of file GoSafetyCommands.h.
GoSafetyCommands::GoSafetyCommands | ( | const GoBoard & | bd | ) |
void GoSafetyCommands::AddGoGuiAnalyzeCommands | ( | GtpCommand & | cmd | ) |
Definition at line 27 of file GoSafetyCommands.cpp.
void GoSafetyCommands::CmdDameStatic | ( | GtpCommand & | cmd | ) |
Return dame points after running static safety algorithm.
Definition at line 38 of file GoSafetyCommands.cpp.
References GoBoard::AllEmpty(), GoModBoard::Board(), GtpCommand::CheckArgNone(), GoSafetyUtil::FindDamePoints(), GoSafetySolver::FindSafePoints(), and m_bd.
Referenced by Register().
void GoSafetyCommands::CmdGfx | ( | GtpCommand & | cmd | ) |
Information about safe points optimized for graphical display in GoGui.
This command is compatible with GoGui's analyze command type "gfx". Arguments: benson|static
Returns: GoGui gfx commands to display safe points and additional information in the status line
Definition at line 61 of file GoSafetyCommands.cpp.
References GoBoard::AllEmpty(), GoBoard::AllPoints(), GtpCommand::Arg(), GoSafetyUtil::FindDameAndUnsurroundablePoints(), GetSafe(), m_bd, SG_BLACK, SG_WHITE, and SgPointSet::Size().
Referenced by Register().
void GoSafetyCommands::CmdSafe | ( | GtpCommand & | cmd | ) |
List of safe points.
If no color is given, safe points of both colors are listed. Arguments: benson|static [black|white]
Returns: number of point followed bu list of points in one line.
Definition at line 110 of file GoSafetyCommands.cpp.
References GtpCommand::Arg(), GoGtpCommandUtil::BlackWhiteArg(), SgBWSet::Both(), GtpCommand::CheckNuArgLessEqual(), GetSafe(), and GtpCommand::NuArg().
Referenced by Register().
void GoSafetyCommands::CmdWinner | ( | GtpCommand & | cmd | ) |
Definition at line 123 of file GoSafetyCommands.cpp.
References GtpCommand::CheckArgNone(), GoSafetyUtil::GetWinner(), m_bd, SG_BLACK, and SG_WHITE.
Referenced by Register().
SgBWSet GoSafetyCommands::GetSafe | ( | int & | totalRegions, | |
const std::string & | type | |||
) | [private] |
Definition at line 135 of file GoSafetyCommands.cpp.
References GoRegionBoard::AllRegions(), GoModBoard::Board(), SgBWSet::Both(), GoSafetySolver::FindSafePoints(), GoBensonSolver::FindSafePoints(), and m_bd.
void GoSafetyCommands::Register | ( | GtpEngine & | e, | |
const std::string & | command, | |||
GtpCallback< GoSafetyCommands >::Method | method | |||
) | [private] |
Definition at line 173 of file GoSafetyCommands.cpp.
References GtpEngine::Register().
void GoSafetyCommands::Register | ( | GtpEngine & | engine | ) |
Definition at line 165 of file GoSafetyCommands.cpp.
References CmdDameStatic(), CmdGfx(), CmdSafe(), and CmdWinner().
const GoBoard& GoSafetyCommands::m_bd [private] |
Definition at line 43 of file GoSafetyCommands.h.
Referenced by CmdDameStatic(), CmdGfx(), CmdWinner(), and GetSafe().