Functions | |
SgEmptyBlackWhite | EmptyBlackWhiteArg (const GtpCommand &cmd, std::size_t number) |
SgBlackWhite | BlackWhiteArg (const GtpCommand &cmd, std::size_t number) |
SgPoint | EmptyPointArg (const GtpCommand &cmd, std::size_t number, const GoBoard &board) |
SgVector< SgPoint > | GetHandicapStones (int size, int n) |
Return the handicap stone locations as defined by the GTP standard. | |
SgMove | MoveArg (const GtpCommand &cmd, std::size_t number, const GoBoard &board) |
void | ParseMultiStoneArgument (GtpCommand &cmd, const GoBoard &board, SgBlackWhite &toPlay, SgBlackWhite &defender, SgVector< SgPoint > &crucial) |
Parse argument list consisting of toPlay followed by list of stones. | |
SgPoint | PointArg (const GtpCommand &cmd, const GoBoard &board) |
SgPoint | PointArg (const GtpCommand &cmd, std::size_t number, const GoBoard &board) |
SgVector< SgPoint > | PointListArg (const GtpCommand &cmd, std::size_t number, const GoBoard &board) |
Return point list argument starting a given argument number to the end of arguments. | |
SgVector< SgPoint > | PointListArg (const GtpCommand &cmd, const GoBoard &board) |
Return point list argument using all arguments. | |
void | RespondNumberArray (GtpCommand &cmd, const SgPointArray< int > &array, int scale, const GoBoard &board) |
std::string | SortResponseAnalyzeCommands (const std::string &response) |
Sort response to gogui-analyze_commands alphabetically by label. | |
SgPoint | StoneArg (const GtpCommand &cmd, std::size_t number, const GoBoard &board) |
SgBlackWhite GoGtpCommandUtil::BlackWhiteArg | ( | const GtpCommand & | cmd, | |
std::size_t | number | |||
) |
Definition at line 55 of file GoGtpCommandUtil.cpp.
References GtpCommand::ArgToLower(), SG_BLACK, and SG_WHITE.
Referenced by GoSafetyCommands::CmdSafe(), and ParseMultiStoneArgument().
SgEmptyBlackWhite GoGtpCommandUtil::EmptyBlackWhiteArg | ( | const GtpCommand & | cmd, | |
std::size_t | number | |||
) |
Definition at line 41 of file GoGtpCommandUtil.cpp.
References GtpCommand::ArgToLower(), SG_BLACK, SG_EMPTY, and SG_WHITE.
SgPoint GoGtpCommandUtil::EmptyPointArg | ( | const GtpCommand & | cmd, | |
std::size_t | number, | |||
const GoBoard & | board | |||
) |
Definition at line 67 of file GoGtpCommandUtil.cpp.
References GoBoard::GetColor(), PointArg(), and SG_EMPTY.
Return the handicap stone locations as defined by the GTP standard.
See GTP version 2 specification, section 4.1.1 Fixed Handicap Placement.
size | Size of the board. | |
n | Number of handicap stones (0, 2, 3, 4, 5, 6, 7, 8, 9). |
GtpFailure | If handicap locations are not defined for this number and board size. |
Definition at line 78 of file GoGtpCommandUtil.cpp.
References Pt(), SgVector< T >::PushBack(), and SG_MAX_SIZE.
Referenced by GoGtpEngine::CmdFixedHandicap(), and GoGtpEngine::CmdPlaceFreeHandicap().
SgMove GoGtpCommandUtil::MoveArg | ( | const GtpCommand & | cmd, | |
std::size_t | number, | |||
const GoBoard & | board | |||
) |
Definition at line 128 of file GoGtpCommandUtil.cpp.
References GtpCommand::ArgToLower(), PointArg(), and SG_PASS.
void GoGtpCommandUtil::ParseMultiStoneArgument | ( | GtpCommand & | cmd, | |
const GoBoard & | board, | |||
SgBlackWhite & | toPlay, | |||
SgBlackWhite & | defender, | |||
SgVector< SgPoint > & | crucial | |||
) |
Parse argument list consisting of toPlay followed by list of stones.
All stones are of the same 'defender' color.
Definition at line 136 of file GoGtpCommandUtil.cpp.
References BlackWhiteArg(), GoBoard::GetColor(), GtpCommand::NuArg(), SgVector< T >::PushBack(), SG_ASSERT, SG_BLACK, SG_WHITE, SgBW(), SgDebug(), and StoneArg().
SgPoint GoGtpCommandUtil::PointArg | ( | const GtpCommand & | cmd, | |
std::size_t | number, | |||
const GoBoard & | board | |||
) |
Definition at line 165 of file GoGtpCommandUtil.cpp.
References GtpCommand::Arg(), SgMoveUtil::IsCouponMove(), GoBoard::IsValidPoint(), and SG_PASS.
SgPoint GoGtpCommandUtil::PointArg | ( | const GtpCommand & | cmd, | |
const GoBoard & | board | |||
) |
Definition at line 158 of file GoGtpCommandUtil.cpp.
References GtpCommand::CheckNuArg().
Referenced by GoBookCommands::CmdAdd(), GoGtpExtraCommands::CmdCfgDistance(), GoBookCommands::CmdDelete(), EmptyPointArg(), MoveArg(), PointListArg(), and StoneArg().
SgVector< SgPoint > GoGtpCommandUtil::PointListArg | ( | const GtpCommand & | cmd, | |
std::size_t | number, | |||
const GoBoard & | board | |||
) |
Return point list argument starting a given argument number to the end of arguments.
Definition at line 183 of file GoGtpCommandUtil.cpp.
References GtpCommand::NuArg(), PointArg(), and SgVector< T >::PushBack().
Referenced by PointListArg().
SgVector< SgPoint > GoGtpCommandUtil::PointListArg | ( | const GtpCommand & | cmd, | |
const GoBoard & | board | |||
) |
Return point list argument using all arguments.
Definition at line 82 of file GoGtpCommandUtil.h.
References PointListArg().
void GoGtpCommandUtil::RespondNumberArray | ( | GtpCommand & | cmd, | |
const SgPointArray< int > & | array, | |||
int | scale, | |||
const GoBoard & | board | |||
) |
Definition at line 193 of file GoGtpCommandUtil.cpp.
References GoBoard::Size().
string GoGtpCommandUtil::SortResponseAnalyzeCommands | ( | const std::string & | response | ) |
Sort response to gogui-analyze_commands alphabetically by label.
Useful if the response to gogui-analyze_commands was concatenated from different components and should be displayed alphabetically.
response | Old response in the format expected by gogui-analyze_commands |
Definition at line 211 of file GoGtpCommandUtil.cpp.
SgPoint GoGtpCommandUtil::StoneArg | ( | const GtpCommand & | cmd, | |
std::size_t | number, | |||
const GoBoard & | board | |||
) |
Definition at line 226 of file GoGtpCommandUtil.cpp.
References GoBoard::GetColor(), PointArg(), and SG_EMPTY.
Referenced by GoGtpExtraCommands::CmdLadder(), GoGtpExtraCommands::CmdStaticLadder(), and ParseMultiStoneArgument().