class TGameObjectHandle

template<typename T>
Inherits: GameObjectHandle

A handle that can point to various types of game objects.

It primarily keeps track if the object is still alive, so anything still referencing it doesn't accidentally use it.

Public

Constructors

TGameObjectHandle<T>

Constructs a new empty handle.

TGameObjectHandle<T>

TGameObjectHandle<T>(std::nullptr_t)

Constructs a new empty handle.

TGameObjectHandle<T>

TGameObjectHandle<T>(const TGameObjectHandle<T> &other) = default

Copy constructor from another handle of the same type.

TGameObjectHandle<T>

TGameObjectHandle<T>(TGameObjectHandle<T> &&other) = default

Move constructor from another handle of the same type.

Methods

Get

T *Get() const

Returns a pointer to the referenced GameObject.

GetShared

SPtr<T> GetShared() const

Returns a smart pointer to the referenced GameObject.

Operators

operator=

TGameObjectHandle<T> &operator=(std::nullptr_t)

Invalidates the handle.

operator=

TGameObjectHandle<T> &operator=(const TGameObjectHandle<T> &other) = default

Copy assignment

operator=

TGameObjectHandle<T> &operator=(TGameObjectHandle<T> &&other) = default

Move assignment

operator->

T *operator->() const

Returns pointer to the referenced GameObject.

operator*

T &operator*() const

Returns reference to the referenced GameObject.

Internal

Operators

operator int Bool_struct::*

operator int Bool_struct<T>::*() const

Allows direct conversion of handle to bool.

Protected

Constructors

TGameObjectHandle<T>