Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

GoBookCommands Class Reference

#include <GoBook.h>

List of all members.


Detailed Description

GTP commands for GoBook.

Definition at line 167 of file 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

GoGtpEnginem_engine
const GoBoardm_bd
GoBookm_book
std::string m_fileName


Constructor & Destructor Documentation

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

Definition at line 360 of file GoBook.cpp.


Member Function Documentation

void GoBookCommands::AddGoGuiAnalyzeCommands ( GtpCommand cmd  ) 

Definition at line 367 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(), GtpCommand::CheckNuArg(), m_bd, m_book, GoGtpCommandUtil::PointArg(), PositionInfo(), and SgException::what().

Referenced by Register().

void GoBookCommands::CmdClear ( GtpCommand cmd  ) 

Definition at line 400 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 410 of file GoBook.cpp.

References GtpCommand::CheckNuArg(), 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 430 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 437 of file GoBook.cpp.

References GtpCommand::Arg(), GtpCommand::CheckNuArg(), m_book, m_fileName, GoBook::Read(), and SgException::what().

Referenced by Register().

void GoBookCommands::CmdMoves ( GtpCommand cmd  ) 

Definition at line 452 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 469 of file GoBook.cpp.

References GtpCommand::CheckArgNone(), and PositionInfo().

Referenced by Register().

void GoBookCommands::CmdSave ( GtpCommand cmd  ) 

Definition at line 475 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 491 of file GoBook.cpp.

References GtpCommand::Arg(), GtpCommand::CheckNuArg(), m_book, m_engine, m_fileName, GoGtpEngine::MpiSynchronizer(), and GoBook::Write().

Referenced by Register().

void GoBookCommands::PositionInfo ( GtpCommand cmd  )  [private]

Definition at line 507 of file GoBook.cpp.

References GoModBoard::Board(), Contains(), GoBook::Line(), GoBook::LookupAllMoves(), m_bd, and m_book.

Referenced by CmdAdd(), CmdDelete(), and CmdPosition().

void GoBookCommands::Register ( GtpEngine e  ) 

Definition at line 536 of file GoBook.cpp.

References CmdAdd(), CmdClear(), CmdDelete(), CmdInfo(), CmdLoad(), CmdMoves(), CmdPosition(), CmdSave(), CmdSaveAs(), and GtpEngine::Register().

Referenced by GoGtpEngine::GoGtpEngine().


Member Data Documentation

const GoBoard& GoBookCommands::m_bd [private]

Definition at line 204 of file GoBook.h.

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

GoBook& GoBookCommands::m_book [private]

Definition at line 206 of file GoBook.h.

Referenced by CmdAdd(), CmdClear(), CmdDelete(), CmdInfo(), CmdLoad(), CmdMoves(), CmdSave(), CmdSaveAs(), and PositionInfo().

GoGtpEngine& GoBookCommands::m_engine [private]

Definition at line 202 of file GoBook.h.

Referenced by CmdSave(), and CmdSaveAs().

std::string GoBookCommands::m_fileName [private]

Definition at line 208 of file GoBook.h.

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


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


17 Jun 2010 Doxygen 1.4.7