Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

BoardUtils.hpp File Reference

#include "Hex.hpp"
#include "HexBoard.hpp"

Go to the source code of this file.

Namespaces

namespace  BoardUtils
 

Utilities on Boards.


Functions

std::string BoardUtils::GuiDumpOutsideConsiderSet (const StoneBoard &brd, const bitset_t &consider, const bitset_t &remove)
 Dumps all cells outside the consider set and the remove set in a format the gui expects.
Cells

HexPoint BoardUtils::CoordsToPoint (const ConstBoard &brd, int x, int y)
 Returns HexPoint at the coordinates (x, y).
HexPoint BoardUtils::PointInDir (const ConstBoard &brd, HexPoint p, HexDirection dir)
 Returns HexPoint in direction dir from the point p.
HexPoint BoardUtils::Rotate (const ConstBoard &brd, HexPoint p)
 Rotates the given point 180' about the center of the board.
HexPoint BoardUtils::Mirror (const ConstBoard &brd, HexPoint p)
 Mirrors the given point in the diagonal joining acute corners.
HexPoint BoardUtils::CenterPoint (const ConstBoard &brd)
 Returns the center point on boards where both dimensions are odd (fails on all other boards).
HexPoint BoardUtils::CenterPointRight (const ConstBoard &brd)
 These two methods return the two points nearest the center of the board.
HexPoint BoardUtils::CenterPointLeft (const ConstBoard &brd)
HexPoint BoardUtils::RandomEmptyCell (const StoneBoard &brd)
 Returns a random empty cell or INVALID_POINT if the board is full.
Bitsets

bitset_t BoardUtils::PackBitset (const ConstBoard &brd, const bitset_t &in)
 Packs a bitset on this boardsize.
bitset_t BoardUtils::UnpackBitset (const ConstBoard &brd, const bitset_t &in)
 Unpacks a bitset to the canonical representation.
bool BoardUtils::ShiftBitset (const ConstBoard &brd, const bitset_t &bs, HexDirection dir, bitset_t &out)
 Shifts bitset in direction dir using PointInDir().
bitset_t BoardUtils::Rotate (const ConstBoard &brd, const bitset_t &bs)
 Rotates the given bitset 180' about the center of the board.
bitset_t BoardUtils::Mirror (const ConstBoard &brd, const bitset_t &bs)
 Mirrors the given bitset in the acute diagonal (requires that width equals height).
bool BoardUtils::ConnectedOnBitset (const ConstBoard &brd, const bitset_t &carrier, HexPoint p1, HexPoint p2)
 Returns true if p1 is connected to p2 on the bitset; p1 and p2 are assumed to be inside the bitset.
bitset_t BoardUtils::ReachableOnBitset (const ConstBoard &brd, const bitset_t &carrier, const bitset_t &stopset, HexPoint start)
 Returns a subset of carrier: the points that are reachable from start.
Decompositions

void BoardUtils::InitializeDecompositions ()
 Must be called before any decomposition related function is called.
bool BoardUtils::FindCombinatorialDecomposition (const HexBoard &brd, HexColor color, bitset_t &captured)
 Returns true if there is a combinatorial decomposition for color where the opposing color edges are VC-connected.
bool BoardUtils::FindSplittingDecomposition (const HexBoard &brd, HexColor color, HexPoint &group)
 Returns true if there is a combinatorial decomposition for color that splits the board (i.e.

Detailed Description

Definition in file BoardUtils.hpp.


6 Jan 2011 Doxygen 1.6.3