Data related to a block of stones on the board. More...
Public Types | |
typedef SgArrayList< SgPoint, MAX_LIBERTIES > | LibertyList |
typedef LibertyList::Iterator | LibertyIterator |
typedef GoPointList::Iterator | StoneIterator |
Public Member Functions | |
SgPoint | Anchor () const |
void | UpdateAnchor (SgPoint p) |
void | AppendLiberty (SgPoint p) |
void | AppendStone (SgPoint p) |
SgBlackWhite | Color () const |
void | ExcludeLiberty (SgPoint p) |
void | Init (SgBlackWhite c, SgPoint anchor) |
void | Init (SgBlackWhite c, SgPoint anchor, GoPointList stones, LibertyList liberties) |
const LibertyList & | Liberties () const |
int | NumLiberties () const |
int | NumStones () const |
void | PopStone () |
void | SetAnchor (SgPoint p) |
const GoPointList & | Stones () const |
Static Public Attributes | |
static const int | MAX_LIBERTIES = (SG_MAX_SIZE / 3) * 2 * SG_MAX_SIZE |
Upper limit for liberties. | |
Private Attributes | |
SgPoint | m_anchor |
SgBlackWhite | m_color |
LibertyList | m_liberties |
GoPointList | m_stones |
Data related to a block of stones on the board.
Definition at line 510 of file GoBoard.h.
typedef LibertyList::Iterator GoBoard::Block::LibertyIterator |
typedef GoPointList::Iterator GoBoard::Block::StoneIterator |
SgPoint GoBoard::Block::Anchor | ( | ) | const |
Definition at line 523 of file GoBoard.h.
References m_anchor.
Referenced by GoBoard::AddStoneToBlock(), GoBoard::CheckConsistencyBlock(), GoBoard::IsInBlock(), GoBoard::KillBlock(), and GoBoard::MergeBlocks().
void GoBoard::Block::AppendLiberty | ( | SgPoint | p | ) |
Definition at line 527 of file GoBoard.h.
References m_liberties, and SgArrayList< T, SIZE >::PushBack().
Referenced by GoBoard::AddLibToAdjBlocks(), GoBoard::AddStoneToBlock(), GoBoard::CreateSingleStoneBlock(), and GoBoard::MergeBlocks().
void GoBoard::Block::AppendStone | ( | SgPoint | p | ) |
Definition at line 529 of file GoBoard.h.
References m_stones, and SgArrayList< T, SIZE >::PushBack().
Referenced by GoBoard::AddStoneToBlock(), and GoBoard::MergeBlocks().
SgBlackWhite GoBoard::Block::Color | ( | ) | const |
Definition at line 531 of file GoBoard.h.
References m_color.
Referenced by GoBoard::CheckConsistencyBlock(), GoBoard::FullBoardRepetition(), GoBoard::IsLibertyOfBlock(), GoBoard::KillBlock(), and GoBoard::RemoveLibAndKill().
void GoBoard::Block::ExcludeLiberty | ( | SgPoint | p | ) |
Definition at line 533 of file GoBoard.h.
References SgArrayList< T, SIZE >::Exclude(), and m_liberties.
Referenced by GoBoard::RemoveLibAndKill(), and GoBoard::UpdateBlocksAfterUndo().
void GoBoard::Block::Init | ( | SgBlackWhite | c, | |
SgPoint | anchor, | |||
GoPointList | stones, | |||
LibertyList | liberties | |||
) |
Definition at line 544 of file GoBoard.h.
References SgArrayList< T, SIZE >::Contains(), m_anchor, m_color, m_liberties, m_stones, SG_ASSERT, and SG_ASSERT_BW.
void GoBoard::Block::Init | ( | SgBlackWhite | c, | |
SgPoint | anchor | |||
) |
Definition at line 535 of file GoBoard.h.
References SgArrayList< T, SIZE >::Clear(), m_anchor, m_color, m_liberties, m_stones, SgArrayList< T, SIZE >::SetTo(), and SG_ASSERT_BW.
Referenced by GoBoard::CreateSingleStoneBlock(), GoBoard::InitBlock(), and GoBoard::MergeBlocks().
const LibertyList& GoBoard::Block::Liberties | ( | ) | const |
Definition at line 555 of file GoBoard.h.
References m_liberties.
Referenced by GoBoard::CheckConsistencyBlock(), and GoBoard::MergeBlocks().
int GoBoard::Block::NumLiberties | ( | ) | const |
Definition at line 557 of file GoBoard.h.
References SgArrayList< T, SIZE >::Length(), and m_liberties.
Referenced by GoBoard::OccupiedInAtari(), and GoBoard::RemoveLibAndKill().
int GoBoard::Block::NumStones | ( | ) | const |
Definition at line 559 of file GoBoard.h.
References SgArrayList< T, SIZE >::Length(), and m_stones.
void GoBoard::Block::PopStone | ( | ) |
Definition at line 561 of file GoBoard.h.
References m_stones, and SgArrayList< T, SIZE >::PopBack().
Referenced by GoBoard::UpdateBlocksAfterUndo().
void GoBoard::Block::SetAnchor | ( | SgPoint | p | ) |
Definition at line 563 of file GoBoard.h.
References m_anchor.
Referenced by GoBoard::UpdateBlocksAfterUndo().
const GoPointList& GoBoard::Block::Stones | ( | ) | const |
Definition at line 565 of file GoBoard.h.
References m_stones.
Referenced by GoBoard::CheckConsistencyBlock(), GoBoard::FullBoardRepetition(), GoBoard::KillBlock(), GoBoard::MergeBlocks(), GoBoard::RestoreKill(), and GoBoard::UpdateBlocksAfterUndo().
void GoBoard::Block::UpdateAnchor | ( | SgPoint | p | ) |
Definition at line 525 of file GoBoard.h.
References m_anchor.
Referenced by GoBoard::AddStoneToBlock(), and GoBoard::MergeBlocks().
SgPoint GoBoard::Block::m_anchor [private] |
Definition at line 568 of file GoBoard.h.
Referenced by Anchor(), Init(), SetAnchor(), and UpdateAnchor().
SgBlackWhite GoBoard::Block::m_color [private] |
LibertyList GoBoard::Block::m_liberties [private] |
Definition at line 572 of file GoBoard.h.
Referenced by AppendLiberty(), ExcludeLiberty(), Init(), Liberties(), and NumLiberties().
GoPointList GoBoard::Block::m_stones [private] |
Definition at line 574 of file GoBoard.h.
Referenced by AppendStone(), Init(), NumStones(), PopStone(), and Stones().
const int GoBoard::Block::MAX_LIBERTIES = (SG_MAX_SIZE / 3) * 2 * SG_MAX_SIZE [static] |