2021-01-11 20:31:40 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <hex.hpp>
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <string_view>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <nlohmann/json.hpp>
|
|
|
|
|
|
|
|
namespace hex {
|
|
|
|
|
|
|
|
class ContentRegistry {
|
|
|
|
public:
|
|
|
|
ContentRegistry() = delete;
|
|
|
|
|
|
|
|
struct Settings {
|
|
|
|
Settings() = delete;
|
|
|
|
|
|
|
|
struct Entry {
|
|
|
|
std::string name;
|
|
|
|
std::function<bool(nlohmann::json&)> callback;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void load();
|
|
|
|
static void store();
|
|
|
|
|
|
|
|
static void add(std::string_view category, std::string_view name, s64 defaultValue, const std::function<bool(nlohmann::json&)> &callback);
|
|
|
|
static void add(std::string_view category, std::string_view name, std::string_view defaultValue, const std::function<bool(nlohmann::json&)> &callback);
|
|
|
|
|
|
|
|
static std::map<std::string, std::vector<Entry>>& getEntries();
|
|
|
|
static nlohmann::json& getSettingsData();
|
|
|
|
};
|
2021-01-11 21:11:03 +01:00
|
|
|
|
|
|
|
struct Events {
|
|
|
|
static auto get(std::string_view name);
|
|
|
|
};
|
2021-01-11 20:31:40 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|