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

Runtime-state serialization for state hot reload. 更多...

#include <IStateProvider.h>

Public 成员函数

virtual ~IStateProvider ()=default
 I state provider.
 
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).
 
virtual StateReloadPolicy reloadPolicy () const
 Whether live state is preserved or reset across code reload.
 

静态 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 第 28 行定义.

构造及析构函数说明

◆ ~IStateProvider()

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

I state provider.

成员函数说明

◆ captureState()

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

Serialize current runtime state into out.

◆ reloadPolicy()

virtual StateReloadPolicy eve::caps::IStateProvider::reloadPolicy ( ) const
inlinevirtual

Whether live state is preserved or reset across code reload.

在文件 IStateProvider.h 第 51 行定义.

◆ resetToDefaults()

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

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

被这些函数引用 eve::dev::resetNativeStateProviders().

◆ 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.h 第 30 行定义.


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