ChessGame.h
Go to the documentation of this file.
1 // cwchessboard -- A C++ chessboard tool set
2 //
3 //! @file ChessGame.h This file contains the declaration of class ChessGame.
4 //
5 // Copyright (C) 2008 - 2010, 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 #ifndef CHESSGAME_H
25 #define CHESSGAME_H
26 
27 #ifndef USE_PCH
28 #include <vector>
29 #endif
30 
31 #include "MetaData.h"
32 #include "GameNode.h"
33 #include "PgnGame.h"
34 
35 namespace cwchess {
36 
37 class ChessGame {
38  private:
39  MetaData M_meta_data;
40  std::vector<GameNode> M_nodes;
41 
42  public:
43  //! @brief Construct an uninitialized ChessGame object.
44  ChessGame(void) { }
45 
46  //! @brief Access the meta data of the game.
47  MetaData const& meta_data(void) const { return M_meta_data; }
48 
49  //! @brief Access the game nodes of the game.
50  std::vector<GameNode> const& nodes(void) const { M_nodes; }
51 
52  //! @brief Read a game from a PGN file.
53  void read(pgn::Game const& pgn_game);
54 };
55 
56 } // namespace cwchess
57 
58 #endif // CHESSGAME_H
ChessGame(void)
Construct an uninitialized ChessGame object.
Definition: ChessGame.h:44
A namespace for all chess related objects that are not related to the GUI.
Definition: Array.h:39
This file contains the declaration of class MetaData.
void read(pgn::Game const& pgn_game)
Read a game from a PGN file.
This file contains the declaration of class PgnGame.
MetaData const & meta_data(void) const
Access the meta data of the game.
Definition: ChessGame.h:47
std::vector< GameNode > const & nodes(void) const
Access the game nodes of the game.
Definition: ChessGame.h:50
This file contains the declaration of class GameNode.

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