载入中...
搜索中...
未找到
eve::rts::EntityLink< Tag > 模板类 参考

Generation-checked link to an ECS entity. 更多...

#include <RTSTypes.h>

Public 成员函数

bool isBound () const noexcept
 Whether a handle has been assigned, including a stale one.
 
bool isStale () const noexcept
 Whether the assigned target no longer resolves at its generation.
 
ecs::Entity * resolve () const noexcept
 Resolve the target for this call, or return null when stale.
 
const ecs::EntityHandle & handle () const noexcept
 Return the local runtime handle retained by this link.
 
void reset () noexcept
 Clear the relationship after source-side destruction.
 

静态 Public 成员函数

static Result< EntityLink > bind (ecs::EntityHandle handle)
 Bind a live ECS handle, rejecting a null or stale handle.
 
static EntityLink fromHandleForRestore (ecs::EntityHandle handle) noexcept
 Rehydrate a serialized runtime link before its target is known.
 

详细描述

template<typename Tag>
class eve::rts::EntityLink< Tag >

Generation-checked link to an ECS entity.

The link owns no target. bind() validates the handle immediately; resolve() performs the generation check again, so target destruction or slot reuse becomes observable as a stale link. fromHandleForRestore() is reserved for restore/import code that will validate before use.

EntityLink public API.

在文件 RTSTypes.h 第 181 行定义.

成员函数说明

◆ bind()

template<typename Tag >
static Result< EntityLink > eve::rts::EntityLink< Tag >::bind ( ecs::EntityHandle  handle)
inlinestatic

Bind a live ECS handle, rejecting a null or stale handle.

Failure.

Error.

Success.

在文件 RTSTypes.h 第 184 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::rts::EntityLink< Tag >::handle(), eve::StaleHandle , 以及 eve::Result< T >::success().

◆ fromHandleForRestore()

template<typename Tag >
static EntityLink eve::rts::EntityLink< Tag >::fromHandleForRestore ( ecs::EntityHandle  handle)
inlinestaticnoexcept

Rehydrate a serialized runtime link before its target is known.

备注
The returned link must be checked with isStale()/resolve() before use.

在文件 RTSTypes.h 第 202 行定义.

引用了 eve::rts::EntityLink< Tag >::handle().

◆ handle()

template<typename Tag >
const ecs::EntityHandle & eve::rts::EntityLink< Tag >::handle ( ) const
inlinenoexcept

Return the local runtime handle retained by this link.

在文件 RTSTypes.h 第 216 行定义.

被这些函数引用 eve::rts::EntityLink< Tag >::bind() , 以及 eve::rts::EntityLink< Tag >::fromHandleForRestore().

◆ isBound()

template<typename Tag >
bool eve::rts::EntityLink< Tag >::isBound ( ) const
inlinenoexcept

Whether a handle has been assigned, including a stale one.

在文件 RTSTypes.h 第 210 行定义.

◆ isStale()

template<typename Tag >
bool eve::rts::EntityLink< Tag >::isStale ( ) const
inlinenoexcept

Whether the assigned target no longer resolves at its generation.

在文件 RTSTypes.h 第 212 行定义.

◆ reset()

template<typename Tag >
void eve::rts::EntityLink< Tag >::reset ( )
inlinenoexcept

Clear the relationship after source-side destruction.

在文件 RTSTypes.h 第 218 行定义.

◆ resolve()

template<typename Tag >
ecs::Entity * eve::rts::EntityLink< Tag >::resolve ( ) const
inlinenoexcept

Resolve the target for this call, or return null when stale.

在文件 RTSTypes.h 第 214 行定义.

被这些函数引用 eve::rts::RTSProjectileSystem::step().


该类的文档由以下文件生成: