#include <GoGtpExtraCommands.h>
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 21 of file GoGtpExtraCommands.h.
Public Member Functions | |
GoGtpExtraCommands (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 | |
GoBoard & | m_bd |
GoGtpExtraCommands::GoGtpExtraCommands | ( | GoBoard & | bd | ) |
void GoGtpExtraCommands::AddGoGuiAnalyzeCommands | ( | GtpCommand & | cmd | ) |
Definition at line 29 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 44 of file GoGtpExtraCommands.cpp.
References GoBoard::Anchor(), GoBoardUtil::CfgDistance(), GtpCommand::CheckNuArgLessEqual(), GtpCommand::IntArg(), 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 65 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 91 of file GoGtpExtraCommands.cpp.
References GtpCommand::CheckNuArg(), GoBoard::GetColor(), GoStaticLadder::IsLadder(), m_bd, SgOppBW(), and GoGtpCommandUtil::StoneArg().
Referenced by Register().
void GoGtpExtraCommands::Register | ( | GtpEngine & | e, | |
const std::string & | command, | |||
GtpCallback< GoGtpExtraCommands >::Method | method | |||
) | [private] |
void GoGtpExtraCommands::Register | ( | GtpEngine & | engine | ) |
Definition at line 104 of file GoGtpExtraCommands.cpp.
References CmdCfgDistance(), CmdLadder(), and CmdStaticLadder().
GoBoard& GoGtpExtraCommands::m_bd [private] |
Definition at line 47 of file GoGtpExtraCommands.h.
Referenced by CmdCfgDistance(), CmdLadder(), and CmdStaticLadder().