Iterator over all 4 diagonal neighbor points. More...
#include <SgNbIterator.h>
Public Member Functions | |
SgNb4DiagIterator (SgPoint p) | |
void | operator++ () |
Advance the state of the iteration to the next element. | |
SgPoint | operator* () const |
Return the value of the current element. | |
operator bool () const | |
Return true if iteration is valid, otherwise false. | |
Private Member Functions | |
SgNb4DiagIterator (const SgNb4DiagIterator &) | |
Not implemented. | |
SgNb4DiagIterator & | operator= (const SgNb4DiagIterator &) |
Not implemented. | |
Private Attributes | |
int | m_next |
SgPoint | m_p |
Static Private Attributes | |
static const int | s_diag [4] |
Iterator over all 4 diagonal neighbor points.
Iterates in sorted order. Does not filter points off board, that would need access to current board
Diagonal neighbors (a subset of SgNb8Iterator).
0 1 \ / p e.g. next[0] = -NS-WE / \ 2 3
Definition at line 69 of file SgNbIterator.h.
SgNb4DiagIterator::SgNb4DiagIterator | ( | SgPoint | p | ) |
Definition at line 72 of file SgNbIterator.h.
References SgPointUtil::InBoardRange(), and SG_ASSERT.
SgNb4DiagIterator::SgNb4DiagIterator | ( | const SgNb4DiagIterator & | ) | [private] |
Not implemented.
SgNb4DiagIterator::operator bool | ( | ) | const |
Return true if iteration is valid, otherwise false.
Definition at line 93 of file SgNbIterator.h.
References m_next.
SgPoint SgNb4DiagIterator::operator* | ( | ) | const |
Return the value of the current element.
Definition at line 87 of file SgNbIterator.h.
void SgNb4DiagIterator::operator++ | ( | ) |
Advance the state of the iteration to the next element.
Definition at line 80 of file SgNbIterator.h.
SgNb4DiagIterator& SgNb4DiagIterator::operator= | ( | const SgNb4DiagIterator & | ) | [private] |
Not implemented.
int SgNb4DiagIterator::m_next [private] |
Definition at line 99 of file SgNbIterator.h.
Referenced by operator bool(), operator*(), and operator++().
SgPoint SgNb4DiagIterator::m_p [private] |
Definition at line 101 of file SgNbIterator.h.
Referenced by operator*().
const int SgNb4DiagIterator::s_diag [static, private] |
Definition at line 103 of file SgNbIterator.h.
Referenced by operator*().