Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

GoBoard::HashCode Class Reference

List of all members.

Detailed Description

Board hash code.

See also:
Hash Code in Class GoBoard

Definition at line 630 of file GoBoard.h.

Public Member Functions

void Clear ()
const SgHashCode & Get () const
SgHashCode GetInclToPlay (SgBlackWhite toPlay) const
void XorCaptured (int moveNumber, SgPoint firstCapturedStone)
void XorStone (SgPoint p, SgBlackWhite c)
void XorWinKo (int level, SgBlackWhite c)

Private Member Functions

 BOOST_STATIC_ASSERT (START_INDEX_TOPLAY >=0)
 BOOST_STATIC_ASSERT (END_INDEX_TOPLAY > START_INDEX_TOPLAY)
 BOOST_STATIC_ASSERT (START_INDEX_STONES > END_INDEX_TOPLAY)
 BOOST_STATIC_ASSERT (END_INDEX_STONES > START_INDEX_STONES)
 BOOST_STATIC_ASSERT (END_INDEX_WINKO > START_INDEX_WINKO)
 BOOST_STATIC_ASSERT (START_INDEX_CAPTURES > END_INDEX_WINKO)
 BOOST_STATIC_ASSERT (END_INDEX_CAPTURES > START_INDEX_CAPTURES)
 BOOST_STATIC_ASSERT (START_INDEX_WINKO+MAX_KOLEVEL *3-1<=END_INDEX_WINKO)
 BOOST_STATIC_ASSERT (END_INDEX_CAPTURES< SgHashZobristTable::MAX_HASH_INDEX)

Private Attributes

SgHashCode m_hash

Static Private Attributes

static const int START_INDEX_TOPLAY = 1
static const int END_INDEX_TOPLAY = 2
static const int START_INDEX_STONES = 3
static const int END_INDEX_STONES = 2 * SG_MAXPOINT
static const int START_INDEX_WINKO = 2 * SG_MAXPOINT + 1
static const int END_INDEX_WINKO = 2 * SG_MAXPOINT + SG_MAX_SIZE + 1
static const int START_INDEX_CAPTURES = 2 * SG_MAXPOINT + SG_MAX_SIZE + 2
static const int END_INDEX_CAPTURES = 3 * SG_MAXPOINT + 63


Member Function Documentation

GoBoard::HashCode::BOOST_STATIC_ASSERT (  )  [private]

Referenced by GetInclToPlay(), XorStone(), and XorWinKo().

GoBoard::HashCode::BOOST_STATIC_ASSERT ( START_INDEX_WINKO+MAX_KOLEVEL *3-1<=  END_INDEX_WINKO  )  [private]

GoBoard::HashCode::BOOST_STATIC_ASSERT ( END_INDEX_CAPTURES  ,
START_INDEX_CAPTURES   
) [private]

GoBoard::HashCode::BOOST_STATIC_ASSERT ( START_INDEX_CAPTURES  ,
END_INDEX_WINKO   
) [private]

GoBoard::HashCode::BOOST_STATIC_ASSERT ( END_INDEX_WINKO  ,
START_INDEX_WINKO   
) [private]

GoBoard::HashCode::BOOST_STATIC_ASSERT ( END_INDEX_STONES  ,
START_INDEX_STONES   
) [private]

GoBoard::HashCode::BOOST_STATIC_ASSERT ( START_INDEX_STONES  ,
END_INDEX_TOPLAY   
) [private]

GoBoard::HashCode::BOOST_STATIC_ASSERT ( END_INDEX_TOPLAY  ,
START_INDEX_TOPLAY   
) [private]

GoBoard::HashCode::BOOST_STATIC_ASSERT ( START_INDEX_TOPLAY >=  0  )  [private]

void GoBoard::HashCode::Clear (  ) 

Definition at line 1151 of file GoBoard.h.

References SgHash< N >::Clear(), and m_hash.

Referenced by GoBoard::Init().

const SgHashCode & GoBoard::HashCode::Get (  )  const

Definition at line 1156 of file GoBoard.h.

References m_hash.

Referenced by GoBoard::GetHashCode().

SgHashCode GoBoard::HashCode::GetInclToPlay ( SgBlackWhite  toPlay  )  const

Definition at line 1161 of file GoBoard.h.

References BOOST_STATIC_ASSERT(), END_INDEX_TOPLAY, m_hash, SG_ASSERTRANGE, SG_BLACK, SG_WHITE, START_INDEX_TOPLAY, and SgHashUtil::XorZobrist().

Referenced by GoBoard::GetHashCodeInclToPlay().

void GoBoard::HashCode::XorCaptured ( int  moveNumber,
SgPoint  firstCapturedStone 
)

Definition at line 1172 of file GoBoard.h.

References END_INDEX_CAPTURES, m_hash, SG_ASSERTRANGE, SG_MAXPOINT, START_INDEX_CAPTURES, and SgHashUtil::XorZobrist().

Referenced by GoBoard::Play().

void GoBoard::HashCode::XorStone ( SgPoint  p,
SgBlackWhite  c 
)

Definition at line 1180 of file GoBoard.h.

References BOOST_STATIC_ASSERT(), END_INDEX_STONES, m_hash, SG_ASSERT_BOARDRANGE, SG_ASSERT_BW, SG_ASSERTRANGE, SG_BLACK, SG_MAXPOINT, SG_WHITE, START_INDEX_STONES, and SgHashUtil::XorZobrist().

Referenced by GoBoard::AddStoneForUndo(), and GoBoard::RemoveStoneForUndo().

void GoBoard::HashCode::XorWinKo ( int  level,
SgBlackWhite  c 
)

Definition at line 1191 of file GoBoard.h.

References BOOST_STATIC_ASSERT(), END_INDEX_WINKO, m_hash, GoBoard::MAX_KOLEVEL, SG_ASSERT, SG_ASSERT_BW, SG_ASSERTRANGE, SG_BLACK, SG_MAXPOINT, SG_WHITE, START_INDEX_WINKO, and SgHashUtil::XorZobrist().

Referenced by GoBoard::CheckKo().


Member Data Documentation

const int GoBoard::HashCode::END_INDEX_CAPTURES = 3 * SG_MAXPOINT + 63 [static, private]

Definition at line 655 of file GoBoard.h.

Referenced by XorCaptured().

const int GoBoard::HashCode::END_INDEX_STONES = 2 * SG_MAXPOINT [static, private]

Definition at line 650 of file GoBoard.h.

Referenced by XorStone().

const int GoBoard::HashCode::END_INDEX_TOPLAY = 2 [static, private]

Definition at line 648 of file GoBoard.h.

Referenced by GetInclToPlay().

const int GoBoard::HashCode::END_INDEX_WINKO = 2 * SG_MAXPOINT + SG_MAX_SIZE + 1 [static, private]

Definition at line 652 of file GoBoard.h.

Referenced by XorWinKo().

SgHashCode GoBoard::HashCode::m_hash [private]

Definition at line 671 of file GoBoard.h.

Referenced by Clear(), Get(), GetInclToPlay(), XorCaptured(), XorStone(), and XorWinKo().

const int GoBoard::HashCode::START_INDEX_CAPTURES = 2 * SG_MAXPOINT + SG_MAX_SIZE + 2 [static, private]

Definition at line 654 of file GoBoard.h.

Referenced by XorCaptured().

const int GoBoard::HashCode::START_INDEX_STONES = 3 [static, private]

Definition at line 649 of file GoBoard.h.

Referenced by XorStone().

const int GoBoard::HashCode::START_INDEX_TOPLAY = 1 [static, private]

Definition at line 647 of file GoBoard.h.

Referenced by GetInclToPlay().

const int GoBoard::HashCode::START_INDEX_WINKO = 2 * SG_MAXPOINT + 1 [static, private]

Definition at line 651 of file GoBoard.h.

Referenced by XorWinKo().


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


17 Jun 2010 Doxygen 1.4.7