Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

VCCommands Class Reference

Commands for building/inspecting virtual connections. More...

#include <VCCommands.hpp>

List of all members.

Public Member Functions

 VCCommands (Game &game, HexEnvironment &env)
 ~VCCommands ()
void Register (GtpEngine &engine)

Private Member Functions

VC::Type VCTypeArg (const HtpCommand &cmd, std::size_t number) const
void Register (GtpEngine &engine, const std::string &command, GtpCallback< VCCommands >::Method method)
void CmdGetVCsBetween (HtpCommand &cmd)
 Returns a list of VCs between the given two cells.
void CmdGetCellsConnectedTo (HtpCommand &cmd)
 Returns a list of cells the given cell shares a vc with.
void CmdGetMustPlay (HtpCommand &cmd)
 Prints the cells in the current mustplay for the given player.
void CmdVCIntersection (HtpCommand &cmd)
 Prints the cells in the all connections between given endpoints.
void CmdVCUnion (HtpCommand &cmd)
 Prints the cells in union of connections between given endpoints.
void CmdBuildStatic (HtpCommand &cmd)
 Builds VCs for both players and displays ice info for the given color in the current board-state.
void CmdBuildIncremental (HtpCommand &cmd)
 Builds VCs incrementally for both players and displays ice info the given color in the current board-state.
void CmdUndoIncremental (HtpCommand &cmd)
 Reverts VCs built incrementally.
void CmdSetInfo (HtpCommand &cmd)
 Obtains statistics on connection set.
void CmdBuilderStats (HtpCommand &cmd)
 Obtains statistics on connection set.

Private Attributes

Gamem_game
HexEnvironmentm_env

Detailed Description

Commands for building/inspecting virtual connections.

Definition at line 19 of file VCCommands.hpp.


Constructor & Destructor Documentation

VCCommands::VCCommands ( Game game,
HexEnvironment env 
)

Definition at line 15 of file VCCommands.cpp.

VCCommands::~VCCommands (  ) 

Definition at line 21 of file VCCommands.cpp.


Member Function Documentation

void VCCommands::CmdBuilderStats ( HtpCommand cmd  )  [private]

Obtains statistics on connection set.

Definition at line 230 of file VCCommands.cpp.

References HexEnvironment::brd, HexBoard::Builder(), HtpUtil::ColorArg(), m_env, VCBuilder::Statistics(), and VCBuilderStatistics::ToString().

Referenced by Register().

void VCCommands::CmdBuildIncremental ( HtpCommand cmd  )  [private]

Builds VCs incrementally for both players and displays ice info the given color in the current board-state.

Usage: "vc-build-incremental [color] [move]"

Definition at line 77 of file VCCommands.cpp.

References InferiorCells::All(), HexEnvironment::brd, HtpUtil::ColorArg(), HexBoard::GetInferiorCells(), HexBoard::GetPosition(), BoardUtils::GuiDumpOutsideConsiderSet(), InferiorCells::GuiOutput(), EndgameUtils::IsDeterminedState(), m_env, HtpUtil::MoveArg(), EndgameUtils::MovesToConsider(), and HexBoard::PlayMove().

Referenced by Register().

void VCCommands::CmdBuildStatic ( HtpCommand cmd  )  [private]

Builds VCs for both players and displays ice info for the given color in the current board-state.

Usage: "vc-build [color]"

Definition at line 56 of file VCCommands.cpp.

References InferiorCells::All(), Game::Board(), HtpUtil::ColorArg(), HexBoard::ComputeAll(), HexBoard::GetInferiorCells(), HexBoard::GetPosition(), BoardUtils::GuiDumpOutsideConsiderSet(), InferiorCells::GuiOutput(), EndgameUtils::IsDeterminedState(), m_env, m_game, EndgameUtils::MovesToConsider(), and HexEnvironment::SyncBoard().

Referenced by Register().

void VCCommands::CmdGetCellsConnectedTo ( HtpCommand cmd  )  [private]

Returns a list of cells the given cell shares a vc with.

Usage: "vc-connected-to x c t", where x is the cell in question, c is the color of the player, and t is the type of vc.

Definition at line 138 of file VCCommands.cpp.

References HexEnvironment::brd, HtpUtil::ColorArg(), VCSetUtil::ConnectedTo(), m_env, HtpUtil::MoveArg(), HexPointUtil::ToString(), and VCTypeArg().

Referenced by Register().

void VCCommands::CmdGetMustPlay ( HtpCommand cmd  )  [private]

Prints the cells in the current mustplay for the given player.

Usage: "vc-get-mustplay [color]"

Definition at line 152 of file VCCommands.cpp.

References HexEnvironment::brd, HtpUtil::ColorArg(), VCUtils::GetMustplay(), BoardUtils::GuiDumpOutsideConsiderSet(), EndgameUtils::IsDeterminedState(), m_env, and EndgameUtils::MovesToConsider().

Referenced by Register().

void VCCommands::CmdGetVCsBetween ( HtpCommand cmd  )  [private]

Returns a list of VCs between the given two cells.

Usage: "vc-between-cells x y c t", where x and y are the cells, c is the color of the player, and t is the type of connection (full,semi).

Definition at line 108 of file VCCommands.cpp.

References HexEnvironment::brd, Groups::CaptainOf(), HtpUtil::ColorArg(), HexBoard::Cons(), HexBoard::GetGroups(), VCSet::GetList(), m_env, HtpUtil::MoveArg(), VCList::softlimit(), VCSet::VCs(), and VCTypeArg().

Referenced by Register().

void VCCommands::CmdSetInfo ( HtpCommand cmd  )  [private]

Obtains statistics on connection set.

Definition at line 210 of file VCCommands.cpp.

References HexEnvironment::brd, HtpUtil::ColorArg(), VCSetUtil::ComputeStatistics(), HexBoard::Cons(), HexBoard::GetGroups(), m_env, and VCSetStatistics::Write().

Referenced by Register().

void VCCommands::CmdUndoIncremental ( HtpCommand cmd  )  [private]

Reverts VCs built incrementally.

Usage: "vc-undo-incremental"

Definition at line 97 of file VCCommands.cpp.

References HexEnvironment::brd, m_env, and UNUSED().

Referenced by Register().

void VCCommands::CmdVCIntersection ( HtpCommand cmd  )  [private]

Prints the cells in the all connections between given endpoints.

Usage: "vc-intersection [from] [to] [color] [vctype]"

Definition at line 174 of file VCCommands.cpp.

References HexEnvironment::brd, Groups::CaptainOf(), HtpUtil::ColorArg(), HexBoard::Cons(), HexBoard::GetGroups(), VCSet::GetList(), VCList::hardIntersection(), m_env, HtpUtil::MoveArg(), HexPointUtil::ToString(), and VCTypeArg().

Referenced by Register().

void VCCommands::CmdVCUnion ( HtpCommand cmd  )  [private]

Prints the cells in union of connections between given endpoints.

Usage: "vc-union [from] [to] [color] [vctype]"

Definition at line 192 of file VCCommands.cpp.

References HexEnvironment::brd, Groups::CaptainOf(), HtpUtil::ColorArg(), HexBoard::Cons(), VCList::getGreedyUnion(), HexBoard::GetGroups(), VCSet::GetList(), m_env, HtpUtil::MoveArg(), HexPointUtil::ToString(), and VCTypeArg().

Referenced by Register().

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

Definition at line 39 of file VCCommands.cpp.

void VCCommands::Register ( GtpEngine &  engine  ) 
VC::Type VCCommands::VCTypeArg ( const HtpCommand cmd,
std::size_t  number 
) const [private]

Member Data Documentation

Definition at line 29 of file VCCommands.hpp.

Referenced by CmdBuildStatic().


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


6 Jan 2011 Doxygen 1.6.3