Runtime-state serialization for state hot reload. 更多...
#include <IStateProvider.h>
Public 成员函数 | |
| virtual | ~IStateProvider ()=default |
| virtual const char * | stateKind () const =0 |
| Stable kind label, e.g. "dialogue" / "anim" / "rpg.casting". | |
| virtual bool | captureState (StateValue &out)=0 |
Serialize current runtime state into out. | |
| virtual bool | restoreState (const StateValue &in, std::string *err=nullptr)=0 |
| Restore captured state onto the (possibly new) definitions. | |
| virtual bool | resetToDefaults ()=0 |
| Reset this provider to its default state (restore fallback). | |
静态 Public 属性 | |
| static constexpr const char * | capabilityName = "IStateProvider" |
详细描述
Runtime-state serialization for state hot reload.
A module that owns mutable runtime state (animation state machines, dialogue sessions, RPG casting, card phases) implements this and registers with eve::cap::addListener<IStateProvider>(). A reload session captures every provider before code/asset reload and restores the captured state afterwards, so running state survives definition changes instead of being reset.
Modules that do not register a provider are treated as stateless and are simply skipped — the same trimming story as IAssetReloader.
在文件 IStateProvider.h 第 22 行定义.
构造及析构函数说明
◆ ~IStateProvider()
|
virtualdefault |
成员函数说明
◆ captureState()
|
pure virtual |
Serialize current runtime state into out.
◆ resetToDefaults()
|
pure virtual |
Reset this provider to its default state (restore fallback).
◆ restoreState()
|
pure virtual |
Restore captured state onto the (possibly new) definitions.
- 返回
- false when the captured state is incompatible with the new definitions; the reload session then falls back to resetToDefaults().
◆ stateKind()
|
pure virtual |
Stable kind label, e.g. "dialogue" / "anim" / "rpg.casting".
类成员变量说明
◆ capabilityName
|
staticconstexpr |
在文件 IStateProvider.h 第 24 行定义.
该类的文档由以下文件生成:
- src/engine/common/IStateProvider.h