载入中...
搜索中...
未找到
SceneObject.cpp
浏览该文件的文档.
1#include "scene/SceneObject.h"
2
3#include <utility>
4
5namespace eve::scene {
6
7eve::Result<SceneObject *> SceneObject::createObject(const std::string &hostName, const std::string &nodeId,
8 eve::SceneObjectId persistentId) {
9 SceneObject *o = SceneObject::create();
10 if (!o)
12 eve::Diagnostic::error(eve::DiagnosticCode::Failed, "scene object creation returned null", "scene.object"));
13 o->meta()->entity = o;
14 o->meta()->hostName = hostName;
15 o->meta()->nodeId = nodeId;
16 o->meta()->persistentId = persistentId;
18}
19
20} // namespace eve::scene
std::string nodeId
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
Move-only operation result carrying either a value or Status.
Definition Result.h:155
static Result success(T value)
Construct a successful result owning value.
Definition Result.h:164
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.h:81
Id128 public API.
Definition Identity.h:112
Per-node ECS identity (created lazily when a node needs script bindings or engine components)....
Definition SceneObject.h:25
static eve::Result< SceneObject * > createObject(const std::string &hostName, const std::string &nodeId, eve::SceneObjectId persistentId={})
Creates an ECS-owned companion object with an explicit ownership contract.