Non-mutable iterator over all moves of a given chess piece. More...
#include <MoveIterator.h>
Public Member Functions | |
Constructors | |
MoveIterator (void) | |
Construct a one-past-the-end MoveIterator. More... | |
MoveIterator (MoveIterator const& iter) | |
Copy-Constructor. | |
MoveIterator (ChessPosition const* chess_position, Index const& index) | |
Construct a fully initialized MoveIterator. More... | |
Assignment operator | |
MoveIterator& | operator= (MoveIterator const& iter) |
Assignment operator. | |
Comparision operators | |
bool | operator== (MoveIterator const& iter) const |
bool | operator!= (MoveIterator const& iter) const |
Accessors | |
Move const& | operator* () const |
Move const* | operator-> (void) const |
Increment and decrement operators | |
MoveIterator& | operator++ () |
MoveIterator | operator++ (int) |
MoveIterator& | operator-- () |
MoveIterator | operator-- (int) |
Protected Attributes | |
ChessPosition const* | M_chess_position |
The underlaying chess position. | |
BitBoard | M_targets |
The targets that this piece can move to. | |
Move | M_current_move |
The actual move that is returned when dereferenced. | |
Non-mutable iterator over all moves of a given chess piece.
This iterator generates the Move objects while advancing to the next move, storing the result in a member variable. The lifetime of the reference or pointer to the Move is therefore equal to the lifetime of the iterator: calling the increment or decrement operators overwrites the previous move.
Usage example:
Definition at line 58 of file MoveIterator.h.
|
inline |
Construct a one-past-the-end MoveIterator.
Definition at line 73 of file MoveIterator.h.
Referenced by MoveIterator().
|
inline |
Construct a fully initialized MoveIterator.
chess_position | : The ChessPosition that we're generating moves for. |
index | : The index of the piece that we're generating moves for. |
Definition at line 34 of file MoveIterator.inl.