Working on save-load system and UI

This commit is contained in:
Vladislav Khorev committed 2026-06-20 21:41:07 +03:00
1 parent 901142385d
commit d7db0faea3
29 files changed
+708 -180

No files matched your search

+4 -3
View File
@@ -6,6 +6,7 @@
#include <Eigen/Core>
#include <Eigen/Geometry>
#include "external/nlohmann/json.hpp"
#include "ISaveable.h"
namespace ZL {
@@ -44,7 +45,7 @@ struct CharacterCreationInfo {
// All serializable game state for a character.
// This is a member of Character; rendering-only data lives in Character itself.
class CharacterState {
class CharacterState : public ISaveable {
public:
// Special index values for attackTargetIndex / faceTargetIndex
static constexpr int kNoTarget = -1; // no target (was nullptr)
@@ -127,8 +128,8 @@ public:
void setHp(float newHp);
// --- Serialisation (runtime mutable fields only; creation info is reloaded from config) ---
void save(nlohmann::json& out) const;
void load(const nlohmann::json& in);
void save(nlohmann::json& out) const override;
void load(const nlohmann::json& in) override;
};
} // namespace ZL