00001 // cwchessboard -- A C++ chessboard tool set 00002 // 00003 //! @file ChessGame.h This file contains the declaration of class ChessGame. 00004 // 00005 // Copyright (C) 2008 - 2010, by 00006 // 00007 // Carlo Wood, Run on IRC <carlo@alinoe.com> 00008 // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt 00009 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 00010 // 00011 // This program is free software: you can redistribute it and/or modify 00012 // it under the terms of the GNU General Public License as published by 00013 // the Free Software Foundation, either version 2 of the License, or 00014 // (at your option) any later version. 00015 // 00016 // This program is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 // GNU General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU General Public License 00022 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00023 00024 #ifndef CHESSGAME_H 00025 #define CHESSGAME_H 00026 00027 #ifndef USE_PCH 00028 #include <vector> 00029 #endif 00030 00031 #include "MetaData.h" 00032 #include "GameNode.h" 00033 #include "PgnGame.h" 00034 00035 namespace cwchess { 00036 00037 class ChessGame { 00038 private: 00039 MetaData M_meta_data; 00040 std::vector<GameNode> M_nodes; 00041 00042 public: 00043 //! @brief Construct an uninitialized ChessGame object. 00044 ChessGame(void) { } 00045 00046 //! @brief Access the meta data of the game. 00047 MetaData const& meta_data(void) const { return M_meta_data; } 00048 00049 //! @brief Access the game nodes of the game. 00050 std::vector<GameNode> const& nodes(void) const { M_nodes; } 00051 00052 //! @brief Read a game from a PGN file. 00053 void read(pgn::Game const& pgn_game); 00054 }; 00055 00056 } // namespace cwchess 00057 00058 #endif // CHESSGAME_H