From 214d46b8e26ae88b13f9a1a9083d36ce83671d46 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Wed, 28 Dec 2022 07:21:30 +0100 Subject: Improve user experience --- src/base_tab/gamebase/GameBase.cpp | 5 +++++ src/base_tab/gamebase/GameBase.hpp | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/base_tab/gamebase') diff --git a/src/base_tab/gamebase/GameBase.cpp b/src/base_tab/gamebase/GameBase.cpp index a4c51ce..3d7b5d3 100644 --- a/src/base_tab/gamebase/GameBase.cpp +++ b/src/base_tab/gamebase/GameBase.cpp @@ -11,4 +11,9 @@ std::shared_ptr OpenDatabase(const std::string &dbpath, bool createIfN return std::shared_ptr(new PGNGameBase(dbpath)); } return nullptr; +} + +std::shared_ptr OpenGameX(const std::string &dbpath, long id){ + std::shared_ptr base=OpenDatabase(dbpath); + return base->GetGame(id); } \ No newline at end of file diff --git a/src/base_tab/gamebase/GameBase.hpp b/src/base_tab/gamebase/GameBase.hpp index 6798330..b84047b 100644 --- a/src/base_tab/gamebase/GameBase.hpp +++ b/src/base_tab/gamebase/GameBase.hpp @@ -35,4 +35,12 @@ public: * @param dbpath * @return std::shared_ptr */ -std::shared_ptr OpenDatabase(const std::string &dbpath, bool createIfNotExist=true); \ No newline at end of file +std::shared_ptr OpenDatabase(const std::string &dbpath, bool createIfNotExist=true); +/** + * @brief Single game open + * + * @param dbpath + * @param id + * @return std::shared_ptr + */ +std::shared_ptr OpenGameX(const std::string &dbpath, long id); \ No newline at end of file -- cgit v1.2.3