1#ifndef CAVOKE_SERVER_GAME_H
2#define CAVOKE_SERVER_GAME_H
3#include <drogon/drogon.h>
4#include <boost/filesystem/path.hpp>
5#include <nlohmann/json.hpp>
7#include "games_storage_config.h"
9namespace cavoke::server::model {
13 std::string display_name;
14 std::string description;
18 std::vector<std::string> role_names;
19 json default_settings;
24 assert(players_num >= 1);
27NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(GameConfig,
38 const std::string CONFIG_FILE;
39 const std::string CLIENT_FILE;
40 const std::string LOGIC_FILE;
43 explicit Game(
const boost::filesystem::path &directory,
44 const GamesStorageConfig &game_storage_config);
47 boost::filesystem::path directory;
48 boost::filesystem::path client_file;
50 boost::filesystem::path logic_file;
52 static bool is_game_directory(
53 const boost::filesystem::path &path,
54 const GamesStorageConfig &games_storage_config);
void validate() const
Validates config. Throws an exception if invalid.