Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Functions

GoGtpCommandUtil Namespace Reference

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< SgPointGetHandicapStones (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< SgPointPointListArg (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< SgPointPointListArg (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)

Function Documentation

SgBlackWhite GoGtpCommandUtil::BlackWhiteArg ( const GtpCommand cmd,
std::size_t  number 
)
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.

SgVector< SgPoint > GoGtpCommandUtil::GetHandicapStones ( int  size,
int  n 
)

Return the handicap stone locations as defined by the GTP standard.

See GTP version 2 specification, section 4.1.1 Fixed Handicap Placement.

Parameters:
size Size of the board.
n Number of handicap stones (0, 2, 3, 4, 5, 6, 7, 8, 9).
Returns:
Location of the handicap stones.
Exceptions:
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 
)
SgPoint GoGtpCommandUtil::PointArg ( const GtpCommand cmd,
const GoBoard board 
)
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.

Parameters:
response Old response in the format expected by gogui-analyze_commands
Returns:
New response, lines sorted by analyze label

Definition at line 211 of file GoGtpCommandUtil.cpp.

SgPoint GoGtpCommandUtil::StoneArg ( const GtpCommand cmd,
std::size_t  number,
const GoBoard board 
)


Sun Mar 13 2011 Doxygen 1.7.1