Working on game state

This commit is contained in:
Vladislav Khorev committed 2026-06-19 18:39:10 +03:00
1 parent b01e970554
commit 2807d82d51
12 files changed
+501 -445

No files matched your search

+8
View File
@@ -2,6 +2,7 @@
#include "dialogue/DialogueDatabase.h"
#include "quest/QuestJournal.h"
#include "external/nlohmann/json.hpp"
#include <functional>
#include <string>
#include <unordered_map>
@@ -40,6 +41,13 @@ public:
void setGlobalFlagStore(std::unordered_map<std::string, int>* store);
void setQuestJournal(Quest::QuestJournal* journal);
// Saves whether a dialogue is active, its id, and current node.
// Cutscene state is not saved.
void save(nlohmann::json& out) const;
// Restores saved dialogue state. Text reveal snaps to completion so the
// typing animation doesn't replay. No callbacks are fired on restore.
void load(const nlohmann::json& in);
private:
enum class Mode {
Inactive,