#include <SgConnCompIterator.h>
Example: compute all blocks of a given color:
for (ConnCompIterator it(board.All(color), board); it; ++it) DO
{
...define block with points '*it' and color 'color'...
}
Definition at line 23 of file SgConnCompIterator.h.
Public Member Functions | |
| SgConnCompIterator (const SgPointSet &set, int boardSize) | |
| Create an iterator to iterate through set on 'board'. | |
| void | operator++ () |
| const SgPointSet & | operator * () const |
| operator bool () const | |
Private Attributes | |
| SgPointSet | m_set |
| SgPointSet | m_nextSet |
| int | m_nextPoint |
| int | m_lastBoardPoint |
| SgConnCompIterator::SgConnCompIterator | ( | const SgPointSet & | set, | |
| int | boardSize | |||
| ) |
Create an iterator to iterate through set on 'board'.
Definition at line 13 of file SgConnCompIterator.cpp.
References operator++(), SG_ASSERTRANGE, and SG_MAX_SIZE.
| const SgPointSet & SgConnCompIterator::operator * | ( | ) | const |
Definition at line 34 of file SgConnCompIterator.cpp.
References m_lastBoardPoint, m_nextPoint, m_nextSet, and SG_ASSERT.
| SgConnCompIterator::operator bool | ( | ) | const |
| void SgConnCompIterator::operator++ | ( | ) |
Definition at line 22 of file SgConnCompIterator.cpp.
References SgPointSet::ConnComp(), m_lastBoardPoint, m_nextPoint, m_nextSet, and m_set.
Referenced by SgConnCompIterator().
int SgConnCompIterator::m_lastBoardPoint [private] |
Definition at line 45 of file SgConnCompIterator.h.
Referenced by operator *(), operator bool(), and operator++().
int SgConnCompIterator::m_nextPoint [private] |
Definition at line 43 of file SgConnCompIterator.h.
Referenced by operator *(), operator bool(), and operator++().
SgPointSet SgConnCompIterator::m_nextSet [private] |
SgPointSet SgConnCompIterator::m_set [private] |