载入中...
搜索中...
未找到
ScriptComponentSnapshot.cpp 文件参考
#include "common/ScriptComponentSnapshot.h"
#include "common/Diagnostic.h"
#include "common/ECS.h"
#include "common/ScriptComponentStore.h"
#include "common/Value.h"
#include <squirrel.h>
#include <simplesquirrel/simplesquirrel.hpp>
#include <algorithm>
#include <cstdint>
#include <map>
#include <string>
#include <utility>
#include <vector>

浏览源代码.

命名空间

namespace  eve
 Build metadata (engine git commit, build time, third-party version).
 

函数

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::vector< ScriptComponentInstanceState > > eve::scriptComponentInstancesOf (const ssq::Object &entityInstance)
 读一个脚本实体实例上挂着的全部**已登记**组件的状态。
 
EVENGINE_API_FOUNDATION Result< std::string > eve::scriptComponentStatesJson ()
 引擎侧脚本组件数据的**工具视图**(MCP eve_script_components 与诊断用)。