Play-/Source/ui_shared/TheGamesDbClient.h
2019-01-31 19:01:31 -05:00

36 lines
675 B
C++

#pragma once
#include <string>
#include <vector>
#include <nlohmann/json.hpp>
#include "Types.h"
#include "Singleton.h"
namespace TheGamesDb
{
struct Game
{
uint32 id;
std::string baseImgUrl;
std::string title;
std::string overview;
std::string boxArtUrl;
std::vector<std::string> discIds;
};
typedef std::vector<Game> GamesList;
class CClient : public CSingleton<CClient>
{
public:
virtual ~CClient() = default;
Game GetGame(uint32 id);
GamesList GetGamesList(const std::string& platformID, const std::string& name);
GamesList GetGames(std::vector<std::string> serials);
private:
GamesList PopulateGameList(const nlohmann::json&);
};
}