Commands for building/inspecting virtual connections. More...
#include <VCCommands.hpp>
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 | |
Game & | m_game |
HexEnvironment & | m_env |
Commands for building/inspecting virtual connections.
Definition at line 19 of file VCCommands.hpp.
VCCommands::VCCommands | ( | Game & | game, | |
HexEnvironment & | env | |||
) |
Definition at line 15 of file VCCommands.cpp.
VCCommands::~VCCommands | ( | ) |
Definition at line 21 of file VCCommands.cpp.
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 | ) |
Definition at line 25 of file VCCommands.cpp.
References CmdBuilderStats(), CmdBuildIncremental(), CmdBuildStatic(), CmdGetCellsConnectedTo(), CmdGetMustPlay(), CmdGetVCsBetween(), CmdSetInfo(), CmdUndoIncremental(), CmdVCIntersection(), and CmdVCUnion().
Referenced by BenzeneHtpEngine::BenzeneHtpEngine().
VC::Type VCCommands::VCTypeArg | ( | const HtpCommand & | cmd, | |
std::size_t | number | |||
) | const [private] |
Definition at line 45 of file VCCommands.cpp.
References HexColorSetUtil::fromString().
Referenced by CmdGetCellsConnectedTo(), CmdGetVCsBetween(), CmdVCIntersection(), and CmdVCUnion().
HexEnvironment& VCCommands::m_env [private] |
Definition at line 31 of file VCCommands.hpp.
Referenced by CmdBuilderStats(), CmdBuildIncremental(), CmdBuildStatic(), CmdGetCellsConnectedTo(), CmdGetMustPlay(), CmdGetVCsBetween(), CmdSetInfo(), CmdUndoIncremental(), CmdVCIntersection(), and CmdVCUnion().
Game& VCCommands::m_game [private] |
Definition at line 29 of file VCCommands.hpp.
Referenced by CmdBuildStatic().