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

GoSafetyCommands Class Reference

GTP commands related to safety solvers. More...

#include <GoSafetyCommands.h>

List of all members.

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.
void CmdWinner (GtpCommand &cmd)

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

Detailed Description

GTP commands related to safety solvers.

Definition at line 17 of file GoSafetyCommands.h.


Constructor & Destructor Documentation

GoSafetyCommands::GoSafetyCommands ( const GoBoard bd  ) 

Constructor.

Parameters:
bd The game board.

Definition at line 22 of file GoSafetyCommands.cpp.


Member Function Documentation

void GoSafetyCommands::AddGoGuiAnalyzeCommands ( GtpCommand cmd  ) 

Definition at line 27 of file GoSafetyCommands.cpp.

void GoSafetyCommands::CmdDameStatic ( GtpCommand cmd  ) 

Return dame points after running static safety algorithm.

Definition at line 38 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

  • black and white territory: safe points
  • Color Magenta (#980098): dame points
  • Color Red: safe for black and white (should not happen)
  • Circle: unsurroundable
  • Status line: point counts, percentage of safe points

Definition at line 61 of file GoSafetyCommands.cpp.

References GoBoard::AllEmpty(), GoBoard::AllPoints(), GtpCommand::Arg(), 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 110 of file GoSafetyCommands.cpp.

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

Referenced by Register().

void GoSafetyCommands::CmdWinner ( GtpCommand cmd  ) 

Definition at line 123 of file GoSafetyCommands.cpp.

References GtpCommand::CheckArgNone(), GoSafetyUtil::GetWinner(), m_bd, SG_BLACK, and SG_WHITE.

Referenced by Register().

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

Definition at line 173 of file GoSafetyCommands.cpp.

References GtpEngine::Register().

void GoSafetyCommands::Register ( GtpEngine engine  ) 

Definition at line 165 of file GoSafetyCommands.cpp.

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


Member Data Documentation

const GoBoard& GoSafetyCommands::m_bd [private]

Definition at line 43 of file GoSafetyCommands.h.

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


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


Sun Mar 13 2011 Doxygen 1.7.1