You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
874 B
44 lines
874 B
/* |
|
* Copyright (C) 2022 Riyyi |
|
* |
|
* SPDX-License-Identifier: MIT |
|
*/ |
|
|
|
#pragma once |
|
|
|
#include "ruc/json/json.h" |
|
|
|
#include "inferno/window.h" |
|
|
|
namespace Inferno { |
|
|
|
struct SettingsProperties { |
|
WindowProperties window; |
|
}; |
|
|
|
class Settings { |
|
public: |
|
static void initialize(); |
|
static void destroy(); |
|
|
|
static bool load(); |
|
static bool save(); |
|
|
|
static inline SettingsProperties& get() { return m_properties; } |
|
|
|
private: |
|
static const char* m_path; |
|
static SettingsProperties m_properties; |
|
}; |
|
|
|
// ----------------------------------------- |
|
|
|
// Json arbitrary type conversion functions |
|
|
|
void toJson(ruc::Json& object, const SettingsProperties& settings); |
|
void fromJson(const ruc::Json& object, SettingsProperties& settings); |
|
|
|
void toJson(ruc::Json& object, const WindowProperties& window); |
|
void fromJson(const ruc::Json& object, WindowProperties& window); |
|
|
|
} // namespace Inferno
|
|
|