2017-10-23 07:35:47 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2019-01-31 19:01:31 -05:00
|
|
|
#include <nlohmann/json.hpp>
|
2017-10-23 07:35:47 -04:00
|
|
|
#include "Types.h"
|
|
|
|
#include "Singleton.h"
|
|
|
|
|
|
|
|
namespace TheGamesDb
|
|
|
|
{
|
|
|
|
struct Game
|
|
|
|
{
|
2019-01-06 13:42:20 +00:00
|
|
|
uint32 id;
|
2017-10-23 07:35:47 -04:00
|
|
|
std::string baseImgUrl;
|
|
|
|
std::string title;
|
|
|
|
std::string overview;
|
|
|
|
std::string boxArtUrl;
|
2019-01-06 13:42:20 +00:00
|
|
|
std::vector<std::string> discIds;
|
2017-10-23 07:35:47 -04:00
|
|
|
};
|
|
|
|
|
2019-01-06 13:42:20 +00:00
|
|
|
typedef std::vector<Game> GamesList;
|
2017-10-23 07:35:47 -04:00
|
|
|
|
|
|
|
class CClient : public CSingleton<CClient>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~CClient() = default;
|
|
|
|
|
2018-08-29 13:53:51 -04:00
|
|
|
Game GetGame(uint32 id);
|
2019-01-06 13:42:20 +00:00
|
|
|
GamesList GetGamesList(const std::string& platformID, const std::string& name);
|
|
|
|
|
|
|
|
GamesList GetGames(std::vector<std::string> serials);
|
|
|
|
|
|
|
|
private:
|
2019-01-31 19:01:31 -05:00
|
|
|
GamesList PopulateGameList(const nlohmann::json&);
|
2017-10-23 07:35:47 -04:00
|
|
|
};
|
|
|
|
}
|