Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

GoSafetyCommands Class Reference

#include <GoSafetyCommands.h>

List of all members.


Detailed Description

GTP commands related to safety solvers.

Definition at line 17 of file GoSafetyCommands.h.

Public Member Functions

 GoSafetyCommands (const GoBoard &bd)
 Constructor.
void AddGoGuiAnalyzeCommands (GtpCommand &cmd)
void Register (GtpEngine &engine)
Command Callbacks
void CmdDameStatic (GtpCommand &cmd)
 Return dame points after running static safety algorithm.
void CmdGfx (GtpCommand &cmd)
 Information about safe points optimized for graphical display in GoGui.
void CmdSafe (GtpCommand &cmd)
 List of safe points.

Private Member Functions

SgBWSet GetSafe (int &totalRegions, const std::string &type)
void Register (GtpEngine &e, const std::string &command, GtpCallback< GoSafetyCommands >::Method method)

Private Attributes

const GoBoardm_bd


Constructor & Destructor Documentation

GoSafetyCommands::GoSafetyCommands ( const GoBoard bd  ) 

Constructor.

Parameters:
bd The game board.

Definition at line 23 of file GoSafetyCommands.cpp.


Member Function Documentation

void GoSafetyCommands::AddGoGuiAnalyzeCommands ( GtpCommand cmd  ) 

Definition at line 28 of file GoSafetyCommands.cpp.

void GoSafetyCommands::CmdDameStatic ( GtpCommand cmd  ) 

Return dame points after running static safety algorithm.

Definition at line 37 of file GoSafetyCommands.cpp.

References GoBoard::AllEmpty(), GoModBoard::Board(), GtpCommand::CheckArgNone(), GoSafetyUtil::FindDamePoints(), GoSafetySolver::FindSafePoints(), and m_bd.

Referenced by Register().

void GoSafetyCommands::CmdGfx ( GtpCommand cmd  ) 

Information about safe points optimized for graphical display in GoGui.

This command is compatible with GoGui's analyze command type "gfx". Arguments: benson|static
Returns: GoGui gfx commands to display safe points and additional information in the status line

Definition at line 61 of file GoSafetyCommands.cpp.

References GoBoard::AllEmpty(), GoBoard::AllPoints(), GtpCommand::Arg(), GtpCommand::CheckNuArg(), GoSafetyUtil::FindDameAndUnsurroundablePoints(), GetSafe(), m_bd, SG_BLACK, SG_WHITE, and SgPointSet::Size().

Referenced by Register().

void GoSafetyCommands::CmdSafe ( GtpCommand cmd  ) 

List of safe points.

If no color is given, safe points of both colors are listed. Arguments: benson|static [black|white]
Returns: number of point followed bu list of points in one line.

Definition at line 112 of file GoSafetyCommands.cpp.

References GtpCommand::Arg(), GoGtpCommandUtil::BlackWhiteArg(), SgBWSet::Both(), GtpCommand::CheckNuArgLessEqual(), GetSafe(), GtpCommand::NuArg(), and SgPointSet::Size().

Referenced by Register().

SgBWSet GoSafetyCommands::GetSafe ( int &  totalRegions,
const std::string &  type 
) [private]

Definition at line 125 of file GoSafetyCommands.cpp.

References GoRegionBoard::AllRegions(), GoModBoard::Board(), SgBWSet::Both(), GoSafetySolver::FindSafePoints(), GoBensonSolver::FindSafePoints(), and m_bd.

Referenced by CmdGfx(), and CmdSafe().

void GoSafetyCommands::Register ( GtpEngine e,
const std::string &  command,
GtpCallback< GoSafetyCommands >::Method  method 
) [private]

Definition at line 162 of file GoSafetyCommands.cpp.

References GtpEngine::Register().

void GoSafetyCommands::Register ( GtpEngine engine  ) 

Definition at line 155 of file GoSafetyCommands.cpp.

References CmdDameStatic(), CmdGfx(), and CmdSafe().


Member Data Documentation

const GoBoard& GoSafetyCommands::m_bd [private]

Definition at line 43 of file GoSafetyCommands.h.

Referenced by CmdDameStatic(), CmdGfx(), and GetSafe().


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


17 Jun 2010 Doxygen 1.4.7