PieceIterator.inl
Go to the documentation of this file.
1 // cwchessboard -- A C++ chessboard tool set
2 //
3 //! @file PieceIterator.inl This file contains the inline definitions of class PieceIterator.
4 //
5 // Copyright (C) 2008, by
6 //
7 // Carlo Wood, Run on IRC <carlo@alinoe.com>
8 // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt
9 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 2 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 
24 namespace cwchess {
25 
27 {
28  return M_chess_position->M_pieces[M_current_index];
29 }
30 
31 inline Piece const* PieceIterator::operator->(void) const
32 {
33  return& M_chess_position->M_pieces[M_current_index];
34 }
35 
36 } // namespace cwchess
A namespace for all chess related objects that are not related to the GUI.
Definition: Array.h:39
Index M_current_index
The index to the current piece, or 64 if this iterator points one passed the end. ...
Definition: PieceIterator.h:46
A particular piece on the board.
Definition: Piece.h:45
Piece operator*() const
Return the Piece that stands on the current index.
ChessPosition const * M_chess_position
The underlaying chess position.
Definition: PieceIterator.h:44
Piece const * operator->(void) const
Return a pointer to the Piece standing on the current index.

Copyright © 2006 - 2010 Carlo Wood.  All rights reserved.