Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Member Functions | Private Attributes

GoBookCommands Class Reference

GTP commands for GoBook. More...

#include <GoBook.h>

List of all members.

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

GoGtpEnginem_engine
const GoBoardm_bd
GoBookm_book
std::string m_fileName

Detailed Description

GTP commands for GoBook.

Definition at line 158 of file GoBook.h.


Constructor & Destructor Documentation

GoBookCommands::GoBookCommands ( GoGtpEngine engine,
const GoBoard bd,
GoBook book 
)

Definition at line 361 of file GoBook.cpp.


Member Function Documentation

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  ) 
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]
void GoBookCommands::Register ( GtpEngine e  ) 

Member Data Documentation

const GoBoard& GoBookCommands::m_bd [private]

Definition at line 194 of file GoBook.h.

Referenced by CmdAdd(), CmdDelete(), CmdMoves(), and PositionInfo().

Definition at line 192 of file GoBook.h.

Referenced by CmdSave(), and CmdSaveAs().

std::string GoBookCommands::m_fileName [private]

Definition at line 198 of file GoBook.h.

Referenced by CmdInfo(), CmdLoad(), CmdSave(), and CmdSaveAs().


The documentation for this class was generated from the following files:


Sun Mar 13 2011 Doxygen 1.7.1