2023-08-05 00:34:31 +02:00
|
|
|
#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-08-05 00:34:31 +02:00
|
|
|
|
2023-11-15 23:07:39 +01:00
|
|
|
#include "game_interface.h"
|
2023-08-05 00:34:31 +02:00
|
|
|
|
2023-08-05 13:51:55 +02:00
|
|
|
namespace Download {
|
|
|
|
|
2023-08-12 19:15:05 +02:00
|
|
|
std::optional<boost::json::object> download_game_json(int game_id);
|
2023-08-05 00:34:31 +02:00
|
|
|
|
2023-08-12 19:15:05 +02:00
|
|
|
std::optional<boost::json::object> open_game_json(const char *filename);
|
2023-08-05 00:34:31 +02:00
|
|
|
|
2023-08-12 19:15:05 +02:00
|
|
|
/**
|
|
|
|
* @brief Create game object from given source
|
|
|
|
* @param game_spec Either an id to download from hanab.live or a filename with a json specification
|
2023-11-10 20:35:05 +01:00
|
|
|
* @param score_goal What score counts as a win for this game. If left empty, the maximum score is inserted.
|
2023-08-12 19:15:05 +02:00
|
|
|
* @return Game state
|
|
|
|
*
|
|
|
|
* If both turn and draw_pile_break are specified, the game skips until the specified turn or the first time the
|
|
|
|
* draw pile hits the given size, whichever comes first
|
|
|
|
*
|
|
|
|
*/
|
2023-11-16 16:03:42 +01:00
|
|
|
Hanabi::Game get_game(int game_id, std::optional<uint8_t> score_goal);
|
|
|
|
|
|
|
|
Hanabi::Game get_game(const std::string& filename, std::optional<uint8_t> score_goal);
|
2023-08-06 22:06:58 +02:00
|
|
|
|
2023-08-12 19:15:05 +02:00
|
|
|
} // namespace Download
|
2023-08-05 00:34:31 +02:00
|
|
|
|
|
|
|
#endif // DYNAMIC_PROGRAM_DOWNLOAD_H
|