GTP commands for GoBook. More...
#include <GoBook.h>
Public Member Functions | |
GoBookCommands (GoGtpEngine &engine, const GoBoard &bd, GoBook &book) | |
void | AddGoGuiAnalyzeCommands (GtpCommand &cmd) |
void | Register (GtpEngine &e) |
Command Callbacks | |
void | CmdAdd (GtpCommand &cmd) |
Add a move for the current position to the book. | |
void | CmdClear (GtpCommand &cmd) |
void | CmdDelete (GtpCommand &cmd) |
Delete a move for the current position to the book. | |
void | CmdInfo (GtpCommand &cmd) |
Show information about current book. | |
void | CmdLoad (GtpCommand &cmd) |
void | CmdMoves (GtpCommand &cmd) |
void | CmdPosition (GtpCommand &cmd) |
Show book information for current positions. | |
void | CmdSave (GtpCommand &cmd) |
void | CmdSaveAs (GtpCommand &cmd) |
Private Member Functions | |
void | PositionInfo (GtpCommand &cmd) |
Private Attributes | |
GoGtpEngine & | m_engine |
const GoBoard & | m_bd |
GoBook & | m_book |
std::string | m_fileName |
GTP commands for GoBook.
Definition at line 158 of file GoBook.h.
GoBookCommands::GoBookCommands | ( | GoGtpEngine & | engine, | |
const GoBoard & | bd, | |||
GoBook & | book | |||
) |
Definition at line 361 of file GoBook.cpp.
void GoBookCommands::AddGoGuiAnalyzeCommands | ( | GtpCommand & | cmd | ) |
Definition at line 368 of file GoBook.cpp.
Referenced by GoGtpEngine::CmdAnalyzeCommands().
void GoBookCommands::CmdAdd | ( | GtpCommand & | cmd | ) |
Add a move for the current position to the book.
Arguments: point
Returns: Position information after the move deletion as in CmdPosition()
Definition at line 385 of file GoBook.cpp.
References GoBook::Add(), m_bd, m_book, GoGtpCommandUtil::PointArg(), PositionInfo(), and SgException::what().
Referenced by Register().
void GoBookCommands::CmdClear | ( | GtpCommand & | cmd | ) |
Definition at line 399 of file GoBook.cpp.
References GtpCommand::CheckArgNone(), GoBook::Clear(), and m_book.
Referenced by Register().
void GoBookCommands::CmdDelete | ( | GtpCommand & | cmd | ) |
Delete a move for the current position to the book.
Arguments: point
Returns: Position information after the move deletion as in CmdPosition()
Definition at line 408 of file GoBook.cpp.
References GoBook::Delete(), GoBook::LookupAllMoves(), m_bd, m_book, GoGtpCommandUtil::PointArg(), PositionInfo(), and SgException::what().
Referenced by Register().
void GoBookCommands::CmdInfo | ( | GtpCommand & | cmd | ) |
Show information about current book.
Definition at line 427 of file GoBook.cpp.
References GtpCommand::CheckArgNone(), m_book, m_fileName, and GoBook::WriteInfo().
Referenced by Register().
void GoBookCommands::CmdLoad | ( | GtpCommand & | cmd | ) |
Definition at line 434 of file GoBook.cpp.
References GtpCommand::Arg(), m_book, m_fileName, GoBook::Read(), and SgException::what().
Referenced by Register().
void GoBookCommands::CmdMoves | ( | GtpCommand & | cmd | ) |
Definition at line 448 of file GoBook.cpp.
References GtpCommand::CheckArgNone(), GoBook::LookupAllMoves(), m_bd, and m_book.
Referenced by Register().
void GoBookCommands::CmdPosition | ( | GtpCommand & | cmd | ) |
Show book information for current positions.
This command is compatible with the GoGui analyze command type "gfx". Moves in the book for the current position are marked with a green color (active moves), moves that lead to a known position in the book with yellow (other moves). The status line shows the line number of the position in the file (0, if unknown) and the number of active and other moves.
Definition at line 464 of file GoBook.cpp.
References GtpCommand::CheckArgNone(), and PositionInfo().
Referenced by Register().
void GoBookCommands::CmdSave | ( | GtpCommand & | cmd | ) |
Definition at line 470 of file GoBook.cpp.
References GtpCommand::CheckArgNone(), m_book, m_engine, m_fileName, GoGtpEngine::MpiSynchronizer(), and GoBook::Write().
Referenced by Register().
void GoBookCommands::CmdSaveAs | ( | GtpCommand & | cmd | ) |
Definition at line 486 of file GoBook.cpp.
References GtpCommand::Arg(), m_book, m_engine, m_fileName, GoGtpEngine::MpiSynchronizer(), and GoBook::Write().
Referenced by Register().
void GoBookCommands::PositionInfo | ( | GtpCommand & | cmd | ) | [private] |
Definition at line 501 of file GoBook.cpp.
References GoModBoard::Board(), GoBoard::IsLegal(), GoBook::Line(), GoBook::LookupAllMoves(), m_bd, m_book, GoBoard::Play(), and GoBoard::Undo().
Referenced by CmdAdd(), CmdDelete(), and CmdPosition().
void GoBookCommands::Register | ( | GtpEngine & | e | ) |
Definition at line 530 of file GoBook.cpp.
References CmdAdd(), CmdClear(), CmdDelete(), CmdInfo(), CmdLoad(), CmdMoves(), CmdPosition(), CmdSave(), CmdSaveAs(), and GtpEngine::Register().
Referenced by GoGtpEngine::GoGtpEngine().
const GoBoard& GoBookCommands::m_bd [private] |
Definition at line 194 of file GoBook.h.
Referenced by CmdAdd(), CmdDelete(), CmdMoves(), and PositionInfo().
GoBook& GoBookCommands::m_book [private] |
Definition at line 196 of file GoBook.h.
Referenced by CmdAdd(), CmdClear(), CmdDelete(), CmdInfo(), CmdLoad(), CmdMoves(), CmdSave(), CmdSaveAs(), and PositionInfo().
GoGtpEngine& GoBookCommands::m_engine [private] |
Definition at line 192 of file GoBook.h.
Referenced by CmdSave(), and CmdSaveAs().
std::string GoBookCommands::m_fileName [private] |