diff options
Diffstat (limited to 'src/base_tab/gamebase')
| -rw-r--r-- | src/base_tab/gamebase/GameBase.cpp | 5 | ||||
| -rw-r--r-- | src/base_tab/gamebase/GameBase.hpp | 10 |
2 files changed, 14 insertions, 1 deletions
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<GameBase> OpenDatabase(const std::string &dbpath, bool createIfN return std::shared_ptr<GameBase>(new PGNGameBase(dbpath)); } return nullptr; +} + +std::shared_ptr<Game> OpenGameX(const std::string &dbpath, long id){ + std::shared_ptr<GameBase> 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<GameBase> */ -std::shared_ptr<GameBase> OpenDatabase(const std::string &dbpath, bool createIfNotExist=true);
\ No newline at end of file +std::shared_ptr<GameBase> OpenDatabase(const std::string &dbpath, bool createIfNotExist=true); +/** + * @brief Single game open + * + * @param dbpath + * @param id + * @return std::shared_ptr<Game> + */ +std::shared_ptr<Game> OpenGameX(const std::string &dbpath, long id);
\ No newline at end of file |
