1 #pragma once 2 3 #include <string> 4 #include <vector> 5 #include <nlohmann/json.hpp> 6 #include "Types.h" 7 #include "Singleton.h" 8 9 namespace TheGamesDb 10 { 11 struct Game 12 { 13 uint32 id; 14 std::string baseImgUrl; 15 std::string title; 16 std::string overview; 17 std::string boxArtUrl; 18 std::vector<std::string> discIds; 19 }; 20 21 typedef std::vector<Game> GamesList; 22 23 class CClient : public CSingleton<CClient> 24 { 25 public: 26 virtual ~CClient() = default; 27 28 Game GetGame(uint32 id); 29 GamesList GetGamesList(const std::string& platformID, const std::string& name); 30 31 GamesList GetGames(std::vector<std::string> serials); 32 33 private: 34 GamesList PopulateGameList(const nlohmann::json&); 35 }; 36 } 37