载入中...
搜索中...
未找到
eve::caps::IStateProvider类 参考abstract

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.h22 行定义.

构造及析构函数说明

◆ ~IStateProvider()

virtual eve::caps::IStateProvider::~IStateProvider ( )
virtualdefault

成员函数说明

◆ captureState()

virtual bool eve::caps::IStateProvider::captureState ( StateValue out)
pure virtual

Serialize current runtime state into out.

◆ resetToDefaults()

virtual bool eve::caps::IStateProvider::resetToDefaults ( )
pure virtual

Reset this provider to its default state (restore fallback).

◆ restoreState()

virtual bool eve::caps::IStateProvider::restoreState ( const StateValue in,
std::string *  err = nullptr 
)
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()

virtual const char * eve::caps::IStateProvider::stateKind ( ) const
pure virtual

Stable kind label, e.g. "dialogue" / "anim" / "rpg.casting".

类成员变量说明

◆ capabilityName

constexpr const char* eve::caps::IStateProvider::capabilityName = "IStateProvider"
staticconstexpr

在文件 IStateProvider.h24 行定义.


该类的文档由以下文件生成: