Extra GTP commands to access functionality of the Go library. More...
#include <GoGtpExtraCommands.h>
Public Member Functions | |
GoGtpExtraCommands (const GoBoard &bd) | |
Constructor. | |
void | AddGoGuiAnalyzeCommands (GtpCommand &cmd) |
void | Register (GtpEngine &engine) |
Command Callbacks | |
void | CmdCfgDistance (GtpCommand &cmd) |
Compute the distance from a point as defined in GoBoardUtil::CfgDistance. | |
void | CmdLadder (GtpCommand &cmd) |
Return fast ladder status. | |
void | CmdStaticLadder (GtpCommand &cmd) |
Return static ladder status. | |
Private Member Functions | |
void | Register (GtpEngine &e, const std::string &command, GtpCallback< GoGtpExtraCommands >::Method method) |
Private Attributes | |
const GoBoard & | m_bd |
Extra GTP commands to access functionality of the Go library.
Contains commands that are mainly useful for debugging and testing the Go library and that not all Go GTP engines may want to register.
Definition at line 19 of file GoGtpExtraCommands.h.
GoGtpExtraCommands::GoGtpExtraCommands | ( | const GoBoard & | bd | ) |
void GoGtpExtraCommands::AddGoGuiAnalyzeCommands | ( | GtpCommand & | cmd | ) |
Definition at line 28 of file GoGtpExtraCommands.cpp.
void GoGtpExtraCommands::CmdCfgDistance | ( | GtpCommand & | cmd | ) |
Compute the distance from a point as defined in GoBoardUtil::CfgDistance.
This command is compatible with GoGui's analyze command type sboard
Argument: point [max_dist]
Returns: Board of integer numbers
Definition at line 42 of file GoGtpExtraCommands.cpp.
References GoBoard::Anchor(), GtpCommand::ArgMin(), GoBoardUtil::CfgDistance(), GtpCommand::CheckNuArgLessEqual(), GoBoard::IsEmpty(), m_bd, GtpCommand::NuArg(), GoGtpCommandUtil::PointArg(), and GoBoard::Size().
Referenced by Register().
void GoGtpExtraCommands::CmdLadder | ( | GtpCommand & | cmd | ) |
Return fast ladder status.
Arguments: prey point
Returns: escaped|captured|unsettled
Definition at line 62 of file GoGtpExtraCommands.cpp.
References GtpCommand::CheckNuArg(), GO_LADDER_CAPTURED, GO_LADDER_ESCAPED, GO_LADDER_UNSETTLED, GoLadderUtil::LadderStatus(), m_bd, and GoGtpCommandUtil::StoneArg().
Referenced by Register().
void GoGtpExtraCommands::CmdStaticLadder | ( | GtpCommand & | cmd | ) |
Return static ladder status.
Arguments: prey point
Returns: escaped|captured|unsettled
Definition at line 87 of file GoGtpExtraCommands.cpp.
References GtpCommand::CheckNuArg(), GoBoard::GetColor(), GoStaticLadder::IsLadder(), m_bd, SgOppBW(), and GoGtpCommandUtil::StoneArg().
Referenced by Register().
void GoGtpExtraCommands::Register | ( | GtpEngine & | engine | ) |
Definition at line 100 of file GoGtpExtraCommands.cpp.
References CmdCfgDistance(), CmdLadder(), and CmdStaticLadder().
void GoGtpExtraCommands::Register | ( | GtpEngine & | e, | |
const std::string & | command, | |||
GtpCallback< GoGtpExtraCommands >::Method | method | |||
) | [private] |
Definition at line 107 of file GoGtpExtraCommands.cpp.
References GtpEngine::Register().
const GoBoard& GoGtpExtraCommands::m_bd [private] |
Definition at line 43 of file GoGtpExtraCommands.h.
Referenced by CmdCfgDistance(), CmdLadder(), and CmdStaticLadder().