MCPcopy Create free account
hub / github.com/esengine/esengine / constructor

Method constructor

packages/core/src/ECS/Entity.ts:163–167  ·  view source on GitHub ↗

* @zh 构造函数 * @en Constructor * * @param name - @zh 实体名称 @en Entity name * @param id - @zh 实体唯一标识符(运行时ID)@en Unique entity identifier (runtime ID) * @param persistentId - @zh 持久化标识符(可选,用于反序列化时恢复)@en Persistent identifier (optional, for deserialization)

(name: string, id: number, persistentId?: string)

Source from the content-addressed store, hash-verified

161 * @param persistentId - @zh 持久化标识符(可选,用于反序列化时恢复)@en Persistent identifier (optional, for deserialization)
162 */
163 constructor(name: string, id: number, persistentId?: string) {
164 this.name = name;
165 this.id = id;
166 this.persistentId = persistentId ?? generateGUID();
167 }
168
169 /**
170 * @zh 获取生命周期策略

Callers

nothing calls this directly

Calls 1

generateGUIDFunction · 0.90

Tested by

no test coverage detected