载入中...
搜索中...
未找到
ECS.h
浏览该文件的文档.
76[[nodiscard]] Result<void> registerScriptComponent(const std::string& name, SchemaVersion version,
84[[nodiscard]] EVENGINE_API_FOUNDATION const ScriptComponentRecord* findScriptComponent(const std::string& name, SchemaVersion version);
90[[nodiscard]] EVENGINE_API_FOUNDATION std::vector<ScriptComponentRecord> scriptComponentRecords();
123[[nodiscard]] EVENGINE_API_FOUNDATION Result<ScriptComponentDeclaredSchema> scriptComponentDeclaredSchema(const std::string& name,
140[[nodiscard]] EVENGINE_API_FOUNDATION Result<Value> readScriptComponentField(const ssq::Object& instance,
153[[nodiscard]] EVENGINE_API_FOUNDATION Result<void> writeScriptComponentField(const ssq::Object& instance, const std::string& field,
Runtime replacement generation for stale-handle rejection.
Move-only, checked operation results for the common layer.
Persistent data-contract version identity.
Owning, renderer-independent dynamic values.
void exposeECSToVM(ssq::VM &vm)
在 ModuleManager::expose 之后调用;保证 eve.Component 等不被其它模块覆盖。
Definition ECS.cpp:1664
Result< ScriptComponentDeclaredSchema > scriptComponentDeclaredSchema(const std::string &name, SchemaVersion version)
读一条已登记组件的声明 schema(字段名 + 声明默认值)。
Definition ECS.cpp:1573
void exposeECS(ssq::Table &table)
脚本侧 ECS:Entity / Component / System / ShaderSystem / view(见 ECS.cpp)。 C++ 游戏实体仍直接用 ECS....
Definition ECS.cpp:1589
void prepareEcsScriptInjection()
Resets per-VM script injection bookkeeping before a new VM is exposed.
Definition ECS.cpp:1624
EVENGINE_API_FOUNDATION Result< Value > readScriptComponentField(const ssq::Object &instance, const std::string &field)
读一个脚本组件实例的字段,**不关心这个字段存在哪**。
std::function< void(ssq::Table &table)> PostEcsHook
在脚本 ECS 基类(eve.Component / eve.Entity / eve.System)注入之后执行的回调。 模块用它注入"extends eve.Entity"的脚本基类(例如 eve....
Definition ECS.h:176
void flushPostEcsHooks(ssq::Table &table)
Run post-ECS hooks that were registered after exposeECS already ran.
Definition ECS.cpp:1650
std::function< void(ssq::Array &out)> CppEntityViewFn
C++ 实体 → 脚本 eve.view() 桥接。 用 registerCppEntityView(cls, fn) 登记脚本类的收集函数; 脚本 eve.view(cls) 沿类链找到登记的 C++...
Definition ECS.h:167
void registerCppEntityView(const ssq::Class &cls, CppEntityViewFn fn)
Registers cpp entity view.
Definition ECS.cpp:1642
std::vector< ScriptComponentRecord > scriptComponentRecords()
当前 VM 的全部登记(含 retired 历史),按名字、版本、代际排序。 @cost 一次拷贝;仅供编辑器/诊断/测试等非热路径使用。
Definition ECS.cpp:1558
EVENGINE_API_FOUNDATION Result< void > writeScriptComponentField(const ssq::Object &instance, const std::string &field, const Value &value)
写一个脚本组件实例的字段,归属规则见 readScriptComponentField。
Result< void > registerScriptComponent(const std::string &name, SchemaVersion version, const ssq::Object &cls)
登记一个脚本组件:eve.component(name, version, cls) 的 C++ 侧。
const ScriptComponentRecord * findScriptComponent(const std::string &name, SchemaVersion version)
当前未退役的那条登记。
Definition ECS.cpp:1549
EVEngine ECS 集成层:底层实现使用 sunxfancy/ECS.hpp https://github.com/sunxfancy/ECS.hpp
Definition ECS.h:21