载入中...
搜索中...
未找到
ScriptComponentStore.cpp
浏览该文件的文档.
35 storeDiagnostic(DiagnosticCode::InvalidArgument, "script component values must be an object", key.name));
47Result<Value> scriptComponentField(const ScriptComponentStoreKey& key, const std::string& field) {
51 storeDiagnostic(DiagnosticCode::NotFound, "no stored values for this component generation", key.name));
59Result<void> setScriptComponentField(const ScriptComponentStoreKey& key, const std::string& field, Value value) {
64 storeDiagnostic(DiagnosticCode::NotFound, "no stored values for this component generation", key.name));
Stable, structured diagnostics shared by engine modules.
脚本组件字段的引擎侧权威存储。
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
Value * find(const std::string &key) noexcept
Return an object member, or nullptr when absent.
Definition Value.cpp:244
std::size_t removeScriptComponentValues(std::uint64_t entityId)
实体销毁时清掉它的全部组件数据。
Definition ScriptComponentStore.cpp:111
@ InvalidArgument
@ NotFound
const Value * findScriptComponentValues(const ScriptComponentStoreKey &key)
读一条组件数据。
Definition ScriptComponentStore.cpp:41
void replaceScriptComponentValues(std::vector< ScriptComponentStoreEntry > entries)
用给定条目**整体替换**存储(恢复快照用)。
Definition ScriptComponentStore.cpp:81
Result< void > setScriptComponentValues(const ScriptComponentStoreKey &key, Value values)
写入一条组件的引擎侧数据(创建实体、或迁移到新代时调用)。
Definition ScriptComponentStore.cpp:32
@ Applied
std::uint64_t scriptComponentStoreRevision()
存储的单调版本号:任何一次写(含恢复、换代对齐、实体销毁)都会 +1。
Definition ScriptComponentStore.cpp:133
Result< void > setScriptComponentField(const ScriptComponentStoreKey &key, const std::string &field, Value value)
写一个字段(脚本侧的写入与原生侧的写入都走这里)。
Definition ScriptComponentStore.cpp:59
std::vector< ScriptComponentStoreEntry > scriptComponentStoreEntries()
列出存储里的全部条目,按 (实体, 组件名, 版本) 升序。
Definition ScriptComponentStore.cpp:73
void reconcileScriptComponentValues(const std::string &name, SchemaVersion version, const std::vector< std::string > &fields, const std::vector< Value > &defaults)
把某个组件(名字 + 版本)在**所有实体**上的数据重建到新 schema 上(热重载换代)。
Definition ScriptComponentStore.cpp:88
Result< Value > scriptComponentField(const ScriptComponentStoreKey &key, const std::string &field)
读一个字段。
Definition ScriptComponentStore.cpp:47