载入中...
搜索中...
未找到
IStateProvider.h
浏览该文件的文档.
1#pragma once
2
3#include "common/Export.h"
4#include "common/StateValue.h"
5
6#include <string>
7
8namespace eve::caps {
9
23public:
24 static constexpr const char* capabilityName = "IStateProvider";
25 virtual ~IStateProvider() = default;
26
28 virtual const char* stateKind() const = 0;
29
31 virtual bool captureState(StateValue& out) = 0;
32
38 virtual bool restoreState(const StateValue& in, std::string* err = nullptr) = 0;
39
41 virtual bool resetToDefaults() = 0;
42};
43
44} // namespace eve::caps
#define EVENGINE_API
宿主(eve / libmain)导出宏;插件从进程导入同一批符号。
Definition Export.h:16
JSON-compatible state value tree used by state hot reload.
Definition StateValue.h:20
Runtime-state serialization for state hot reload.
virtual ~IStateProvider()=default
virtual bool resetToDefaults()=0
Reset this provider to its default state (restore fallback).
virtual bool captureState(StateValue &out)=0
Serialize current runtime state into out.
virtual const char * stateKind() const =0
Stable kind label, e.g. "dialogue" / "anim" / "rpg.casting".
virtual bool restoreState(const StateValue &in, std::string *err=nullptr)=0
Restore captured state onto the (possibly new) definitions.