载入中...
搜索中...
未找到
ScriptComponentSnapshot.h 文件参考

脚本组件数据的持久化信封(方案文档实施顺序第 4 步 / J-3 的存档通路)。 更多...

#include "common/Export.h"
#include "common/Generation.h"
#include "common/Identity.h"
#include "common/Result.h"
#include "common/Revision.h"
#include "common/SchemaVersion.h"
#include "common/Snapshot.h"
#include "common/Time.h"
#include "common/Value.h"
#include <string>
#include <string_view>
#include <vector>

浏览源代码.

类

struct  eve::ScriptComponentInstanceState
 一个脚本实体实例上某个组件的**当前状态**(供引擎工具读取)。 更多...
 

命名空间

namespace  ssq
 EVEngine ECS 集成层:底层实现使用 sunxfancy/ECS.hpp https://github.com/sunxfancy/ECS.hpp
 
namespace  eve
 Build metadata (engine git commit, build time, third-party version).
 

函数

EVENGINE_API_FOUNDATION Result< std::vector< ScriptComponentInstanceState > > eve::scriptComponentInstancesOf (const ssq::Object &entityInstance)
 读一个脚本实体实例上挂着的全部**已登记**组件的状态。
 
EVENGINE_API_FOUNDATION LogicalId eve::scriptComponentSnapshotSchema ()
 脚本组件快照的 payload schema:eve:script-components 版本 1。
 
EVENGINE_API_FOUNDATION Result< SnapshotEnvelope > eve::snapshotScriptComponents (PersistentId instanceId, Revision revision, SimulationTick tick, const SnapshotHashProvider &hashProvider)
 把引擎侧的脚本组件数据封成一个快照信封。
 
EVENGINE_API_FOUNDATION Result< void > eve::restoreScriptComponents (const SnapshotEnvelope &snapshot, const SnapshotHashProvider &hashProvider)
 用快照里的数据**整体替换**当前的脚本组件数据。
 
EVENGINE_API_FOUNDATION Result< std::string > eve::serializeScriptComponentSnapshot (PersistentId instanceId, Revision revision, SimulationTick tick, const SnapshotHashProvider &hashProvider)
 采集并序列化成确定性 JSON(存档写盘用)。 @cost 同 snapshotScriptComponents + 一次序列化。
 
EVENGINE_API_FOUNDATION Result< void > eve::restoreScriptComponentSnapshotJson (std::string_view json, const SnapshotHashProvider &hashProvider)
 从 JSON 解析、校验并恢复。
 
EVENGINE_API_FOUNDATION Result< std::string > eve::scriptComponentStatesJson ()
 引擎侧脚本组件数据的**工具视图**(MCP eve_script_components 与诊断用)。
 

变量

constexpr const char * eve::kScriptComponentSnapshotType = "eve.script-components"
 脚本组件快照的稳定类型(SnapshotEnvelope::type)。
 

详细描述

脚本组件数据的持久化信封(方案文档实施顺序第 4 步 / J-3 的存档通路)。

在文件 ScriptComponentSnapshot.h 中定义.