OChess v0.0.2
Programmer's Manual
PGNGameBase.hpp
1#pragma once
2
3#include "GameBase.hpp"
4#include "pgnp.hpp"
5
10class PGNGameBase : public GameBase {
11 pgnp::PGN *pgn;
12 bool hasNextGame;
13 std::string file;
14
15public:
16 PGNGameBase(std::string pgn_file);
18 std::shared_ptr<Game> GetGame(std::uint32_t id);
19 bool NextGame();
20 std::shared_ptr<Game> GetCurrentGame();
21 std::string GetTag(std::string tag);
22 void Save(std::vector<std::uint32_t> to_delete,
23 std::vector<std::string> databases_to_import,
24 std::vector<std::shared_ptr<Game>> games_to_import);
25 void Reset();
26 void Export(std::shared_ptr<GameBase> base);
27 std::string GetFormat() {return("PGN");};
28 std::string GetFilePath() {return(file);};
29 static std::string GetMovesPGN(HalfMove *m, bool needDots);
30 static std::string GetPGN(std::shared_ptr<Game> g);
31 static void CreateDatabaseFile(std::string path);
32};
Represent the interface that each database type (such as PGNGameBase) must follow to be accessible in...
Definition: GameBase.hpp:10
This class extends CGEHalfMove (to be displayed in the game editor)
Definition: HalfMove.hpp:13
Used to open PGN files.
Definition: PGNGameBase.hpp:10
void Export(std::shared_ptr< GameBase > base)
Save the given base into current base format (export)
Definition: PGNGameBase.cpp:135