24 #ifndef PIECEITERATOR_H 25 #define PIECEITERATOR_H 42 class PieceIterator :
public std::iterator<std::bidirectional_iterator_tag, Piece> {
66 M_chess_position(iter.M_chess_position), M_pieces(iter.M_pieces), M_current_index(iter.M_current_index) { }
90 M_chess_position(chess_position), M_pieces(pieces), M_current_index(get_first_bitindex()) { }
110 M_chess_position(chess_position), M_pieces(pieces), M_current_index(get_last_bitindex()) { }
169 #endif // PIECEITERATOR_H A namespace for all chess related objects that are not related to the GUI.
void prev_bit_in(uint64_t mask)
Retreat Index to the previous bit that is set.
Index M_current_index
The index to the current piece, or 64 if this iterator points one passed the end. ...
void next_bit_in(uint64_t mask)
Advance the index to the next bit that is set in mask.
PieceIterator(ChessPosition const* chess_position, BitBoard pieces)
Construct a fully initialized PieceIterator.
PieceIterator(PieceIterator const& iter)
Copy-constructor.
PieceIterator(ChessPosition const* chess_position, BitBoard pieces, int)
Construct a fully initialized PieceIterator.
A one-boolean-per-square chessboard.
The index of a chess square.
bool operator!=(PieceIterator const& iter) const
Return TRUE if the current index of this PieceIterator and iter differ.
A particular piece on the board.
Piece operator*() const
Return the Piece that stands on the current index.
PieceIterator(int)
Construct the corresponding one-before-the-beginning iterator.
ChessPosition const * M_chess_position
The underlaying chess position.
bool operator==(PieceIterator const& iter) const
Return TRUE if the current index of this PieceIterator and iter are equal.
BitBoard M_pieces
The pieces that the iterator will iterate over.
IndexData const index_pre_begin
A constant representing& #39;one before the start'.
IndexData const index_end
A constant representing& #39;one past the end'.
Non-mutable iterator over selective chess pieces in a chess position.
PieceIterator & operator=(PieceIterator const& iter)
Assign from another PieceIterator.
This file contains the declaration of class Piece.
Piece const * operator->(void) const
Return a pointer to the Piece standing on the current index.
PieceIterator(void)
Construct the corresponding one-passed-the-end iterator.
Index const & index(void) const
Return the current index.