载入中...
搜索中...
未找到
ScriptComponentStore.cpp 文件参考
#include "common/ScriptComponentStore.h"
#include "common/Diagnostic.h"
#include <map>
#include <utility>

浏览源代码.

命名空间

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。