#include <GoSafetyCommands.h>
Definition at line 17 of file 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. | |
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 |
| GoSafetyCommands::GoSafetyCommands | ( | const GoBoard & | bd | ) |
| void GoSafetyCommands::AddGoGuiAnalyzeCommands | ( | GtpCommand & | cmd | ) |
Definition at line 28 of file GoSafetyCommands.cpp.
| void GoSafetyCommands::CmdDameStatic | ( | GtpCommand & | cmd | ) |
Return dame points after running static safety algorithm.
Definition at line 37 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(), GtpCommand::CheckNuArg(), 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 112 of file GoSafetyCommands.cpp.
References GtpCommand::Arg(), GoGtpCommandUtil::BlackWhiteArg(), SgBWSet::Both(), GtpCommand::CheckNuArgLessEqual(), GetSafe(), GtpCommand::NuArg(), and SgPointSet::Size().
Referenced by Register().
| SgBWSet GoSafetyCommands::GetSafe | ( | int & | totalRegions, | |
| const std::string & | type | |||
| ) | [private] |
Definition at line 125 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] |
| void GoSafetyCommands::Register | ( | GtpEngine & | engine | ) |
Definition at line 155 of file GoSafetyCommands.cpp.
References CmdDameStatic(), CmdGfx(), and CmdSafe().
const GoBoard& GoSafetyCommands::m_bd [private] |
Definition at line 43 of file GoSafetyCommands.h.
Referenced by CmdDameStatic(), CmdGfx(), and GetSafe().