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

脚本组件字段的引擎侧权威存储。 更多...

#include "common/Export.h"
#include "common/Result.h"
#include "common/SchemaVersion.h"
#include "common/Value.h"
#include <cstddef>
#include <cstdint>
#include <string>
#include <vector>

浏览源代码.

类

struct  eve::ScriptComponentStoreKey
 一条脚本组件数据的键:实体 + 组件名 + 版本。 更多...
 
struct  eve::ScriptComponentStoreEntry
 存储里的一条数据:键 + 一份字段对象。 更多...
 

命名空间

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

函数

Result< void > eve::setScriptComponentValues (const ScriptComponentStoreKey &key, Value values)
 写入一条组件的引擎侧数据(创建实体、或迁移到新代时调用)。
 
const Value * eve::findScriptComponentValues (const ScriptComponentStoreKey &key)
 读一条组件数据。
 
Result< Value > eve::scriptComponentField (const ScriptComponentStoreKey &key, const std::string &field)
 读一个字段。
 
Result< void > eve::setScriptComponentField (const ScriptComponentStoreKey &key, const std::string &field, Value value)
 写一个字段(脚本侧的写入与原生侧的写入都走这里)。
 
std::vector< ScriptComponentStoreEntry > eve::scriptComponentStoreEntries ()
 列出存储里的全部条目,按 (实体, 组件名, 版本) 升序。
 
void eve::replaceScriptComponentValues (std::vector< ScriptComponentStoreEntry > entries)
 用给定条目**整体替换**存储(恢复快照用)。
 
void eve::reconcileScriptComponentValues (const std::string &name, SchemaVersion version, const std::vector< std::string > &fields, const std::vector< Value > &defaults)
 把某个组件(名字 + 版本)在**所有实体**上的数据重建到新 schema 上(热重载换代)。
 
std::size_t eve::removeScriptComponentValues (std::uint64_t entityId)
 实体销毁时清掉它的全部组件数据。
 
void eve::clearScriptComponentStore ()
 换 VM 时清空:脚本世界连同它的组件数据一起消失。
 
std::size_t eve::scriptComponentStoreSize ()
 当前数据条数(诊断与测试用)。
 
std::uint64_t eve::scriptComponentStoreRevision ()
 存储的单调版本号:任何一次写(含恢复、换代对齐、实体销毁)都会 +1。
 

详细描述

脚本组件字段的引擎侧权威存储。

在文件 ScriptComponentStore.h 中定义.