Endgame-Analyzer/include/download.h

40 lines
1.1 KiB
C
Raw Normal View History

#ifndef DYNAMIC_PROGRAM_DOWNLOAD_H
#define DYNAMIC_PROGRAM_DOWNLOAD_H
#include <iostream>
2023-08-05 11:55:46 +02:00
#include <variant>
2023-11-15 23:07:39 +01:00
#include <optional>
2023-08-12 19:43:22 +02:00
#include <boost/json.hpp>
2023-11-15 23:07:39 +01:00
#include "game_interface.h"
2023-11-16 16:20:04 +01:00
namespace Download
{
std::optional<boost::json::object> download_game_json(int game_id);
std::optional<boost::json::object> open_game_json(char const *filename);
/**
2023-11-16 16:22:49 +01:00
* @brief Create game object from given source.
* @param game_id Id to download from hanab.live.
2023-11-16 16:20:04 +01:00
* @param score_goal What score counts as a win for this game. If left empty, the maximum score is inserted.
* @return Game state
*
*/
Hanabi::Game get_game(int game_id, std::optional<uint8_t> score_goal);
2023-11-16 16:22:49 +01:00
/**
* @brief Create game object from given source.
* @param filename Filename with a json specification of the game in hanab.live format.
* @param score_goal What score counts as a win for this game. If left empty, the maximum score is inserted.
* @return Game state
*
*/
2023-11-16 16:20:04 +01:00
Hanabi::Game get_game(std::string const & filename, std::optional<uint8_t> score_goal);
} // namespace Download
#endif // DYNAMIC_PROGRAM_DOWNLOAD_H