mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-07-14 15:47:39 +00:00
Improve database management
This commit is contained in:
parent
5c8334af1d
commit
5691b7b30f
5 changed files with 26 additions and 1 deletions
|
@ -22,4 +22,9 @@ public:
|
|||
* @param base
|
||||
*/
|
||||
virtual void Export(std::shared_ptr<GameBase> base) = 0;
|
||||
|
||||
/**
|
||||
* @brief An additionnal static method is expected with the following signature:
|
||||
* static void CreateDatabaseFile(std::string path);
|
||||
*/
|
||||
};
|
|
@ -28,6 +28,11 @@ std::string PGNGameBase::GetTag(std::string tag) {
|
|||
return ("");
|
||||
}
|
||||
|
||||
void PGNGameBase::CreateDatabaseFile(std::string path){
|
||||
wxFile empty_pgn(path, wxFile::write);
|
||||
empty_pgn.Close();
|
||||
}
|
||||
|
||||
std::shared_ptr<Game> PGNGameBase::GetCurrentGame() {
|
||||
pgnp::HalfMove *pgnp_moves = new pgnp::HalfMove();
|
||||
pgn->GetMoves(pgnp_moves);
|
||||
|
|
|
@ -22,4 +22,5 @@ public:
|
|||
std::string GetFilePath() {return(file);};
|
||||
static std::string GetMovesPGN(HalfMove *m, bool needDots);
|
||||
static std::string GetPGN(std::shared_ptr<Game> g);
|
||||
static void CreateDatabaseFile(std::string path);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue