Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

HexColor.hpp File Reference

#include "Benzene.hpp"

Go to the source code of this file.

Classes

class  BWIterator
 Iterator over BLACK and WHITE. More...
class  ColorIterator
 Iterator over BLACK and WHITE and EMPTY. More...

Namespaces

namespace  HexColorUtil
 

Basic HexColor utilities.


namespace  HexColorSetUtil
 

Utilities on HexColorSets.


Enumerations

enum  HexColor { BLACK = 0, WHITE = 1, EMPTY = 2 }
 

Available colors of a cell on a Hex board.

More...
enum  HexColorSet {
  BLACK_ONLY, WHITE_ONLY, EMPTY_ONLY, NOT_BLACK,
  NOT_WHITE, NOT_EMPTY, ALL_COLORS, NUM_COLOR_SETS
}
 

All possible sets of available colors.

More...

Functions

bool HexColorUtil::isValidColor (HexColor color)
 Returns true if color is one of BLACK, WHITE, or EMPTY.
bool HexColorUtil::isBlackWhite (HexColor color)
 Returns true if color is BLACK or WHITE.
std::string HexColorUtil::toString (HexColor color)
 Returns a string representation of the given HexColor.
HexColor HexColorUtil::otherColor (HexColor color)
 Returns the opposite color for BLACK and WHITE, EMPTY for EMPTY.
std::ostream & operator<< (std::ostream &os, HexColor color)
 Overrides the standard "<<" operator; same as HexColorUtil::toString().
HexColor operator! (HexColor color)
 Overrides the standard "!" operator to be the same as HexColorUtil::otherColor().
bool HexColorSetUtil::isValid (HexColorSet colorset)
 Returns true if colorset is a valid HexColorSet.
std::string HexColorSetUtil::toString (HexColorSet colorset)
 Converts a HexColorSet to a string.
HexColorSet HexColorSetUtil::fromString (std::string str)
 Converts a string into a HexColorSet.
bool HexColorSetUtil::InSet (HexColor color, HexColorSet colorset)
 Returns true if color is in colorset.
HexColorSet HexColorSetUtil::Only (HexColor color)
 Returns the HexColorSet composed only of color.
HexColorSet HexColorSetUtil::NotColor (HexColor color)
 Returns the HexColorSet containing all but color.
HexColorSet HexColorSetUtil::ColorOrEmpty (HexColor color)
 Returns the HexColorSet containing color or empty; equivalent to:

Variables

static const HexColor FIRST_TO_PLAY = BLACK
 Color of player to move first in a game of Hex.
static const HexColor VERTICAL_COLOR = BLACK
 Color of player who is trying to form a vertical chain (i.e.
static const HexColor DEAD_COLOR = BLACK
 Color that all dead cells are set to.
static const int BLACK_AND_WHITE = 2
 Constant to denote an array to be indexed only by BLACK and WHITE.
static const int BLACK_WHITE_EMPTY = 3
 Constant to denote an array to be indexed by BLACK, WHITE, and EMPTY.

Detailed Description

Definition in file HexColor.hpp.


Enumeration Type Documentation

enum HexColor

Available colors of a cell on a Hex board.

Note:
BLACK=0 and WHITE=1 is currently assumed by many pieces of code.
Enumerator:
BLACK 
WHITE 
EMPTY 

Definition at line 19 of file HexColor.hpp.

All possible sets of available colors.

Enumerator:
BLACK_ONLY 
WHITE_ONLY 
EMPTY_ONLY 
NOT_BLACK 
NOT_WHITE 
NOT_EMPTY 
ALL_COLORS 
NUM_COLOR_SETS 

Definition at line 178 of file HexColor.hpp.


Function Documentation

HexColor operator! ( HexColor  color  )  [inline]

Overrides the standard "!" operator to be the same as HexColorUtil::otherColor().

Definition at line 170 of file HexColor.hpp.

References HexColorUtil::otherColor().

std::ostream& operator<< ( std::ostream &  os,
HexColor  color 
) [inline]

Overrides the standard "<<" operator; same as HexColorUtil::toString().

Definition at line 162 of file HexColor.hpp.

References HexColorUtil::toString().


Variable Documentation

const int BLACK_AND_WHITE = 2 [static]

Constant to denote an array to be indexed only by BLACK and WHITE.

Definition at line 41 of file HexColor.hpp.

Referenced by HexBoard::AddStones(), WolveSearch::ComputeResistance(), Resistance::Evaluate(), ICEngine::FillInMutualFillin(), HexBoard::PlayMove(), and HexBoard::PlayStones().

const int BLACK_WHITE_EMPTY = 3 [static]

Constant to denote an array to be indexed by BLACK, WHITE, and EMPTY.

Definition at line 45 of file HexColor.hpp.

const HexColor DEAD_COLOR = BLACK [static]

Color that all dead cells are set to.

Definition at line 35 of file HexColor.hpp.

Referenced by ICEngine::CliqueCutsetDead(), ICEngine::ComputeDeadCaptured(), InferiorCells::Fillin(), and InferiorCells::GuiOutput().

const HexColor FIRST_TO_PLAY = BLACK [static]
const HexColor VERTICAL_COLOR = BLACK [static]

Color of player who is trying to form a vertical chain (i.e.

joining NORTH to SOUTH).

Definition at line 30 of file HexColor.hpp.

Referenced by HexPointUtil::colorEdge1(), HexPointUtil::colorEdge2(), BoardUtils::Mirror(), SwapCheck::PlaySwap(), and HandicapPlayer::Search().


6 Jan 2011 Doxygen 1.6.3