#include <SgBlackWhite.h>
The function Opp() returns the opponent since this is often needed too.
Usage example:
for (SgBWIterator it; it; ++it) { "this section will be executed twice:" "first with *it == SG_BLACK, then with *it == SG_WHITE" (unless it encounters a break or return inside) }
Definition at line 60 of file SgBlackWhite.h.
Public Member Functions | |
SgBWIterator () | |
void | operator++ () |
Advance the state of the iteration to the next element. | |
SgBlackWhite | operator * () const |
Return the value of the current element. | |
SgBlackWhite | Opp () const |
Return the value of the current element. | |
operator bool () const | |
Return true if iteration is valid, otherwise false. | |
Private Member Functions | |
SgBWIterator (const SgBWIterator &) | |
Not implemented. | |
SgBWIterator & | operator= (const SgBWIterator &) |
Not implemented. | |
Private Attributes | |
int | m_color |
SgBWIterator::SgBWIterator | ( | ) |
Definition at line 63 of file SgBlackWhite.h.
SgBWIterator::SgBWIterator | ( | const SgBWIterator & | ) | [private] |
Not implemented.
SgBlackWhite SgBWIterator::operator * | ( | ) | const |
Return the value of the current element.
Definition at line 75 of file SgBlackWhite.h.
References m_color.
SgBWIterator::operator bool | ( | ) | const |
void SgBWIterator::operator++ | ( | ) |
Advance the state of the iteration to the next element.
Definition at line 68 of file SgBlackWhite.h.
References m_color, and SG_ASSERT_BW.
SgBWIterator& SgBWIterator::operator= | ( | const SgBWIterator & | ) | [private] |
Not implemented.
SgBlackWhite SgBWIterator::Opp | ( | ) | const |
int SgBWIterator::m_color [private] |
Definition at line 93 of file SgBlackWhite.h.
Referenced by operator *(), operator bool(), operator++(), and Opp().