Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Ndk::EntityOwner Class Reference

NDK class that represents the owner of the entity and so its lifetime. More...

Inheritance diagram for Ndk::EntityOwner:
Nz::ObjectHandle< Entity >

Public Member Functions

 EntityOwner (Entity *entity)
 Constructs a EntityOwner object. More...
 
 EntityOwner (const EntityOwner &handle)=delete
 
 EntityOwner (EntityOwner &&handle) noexcept=default
 
 ~EntityOwner ()
 Destructs the object and calls Reset. More...
 
void Reset (Entity *entity=nullptr)
 Resets the ownership of the entity, previous is killed. More...
 
void Reset (EntityOwner &&handle)
 Resets the ownership of the entity by move semantic. More...
 
EntityOwneroperator= (Entity *entity)
 Resets the ownership of the entity to the affected one. More...
 
EntityOwneroperator= (const EntityOwner &handle)=delete
 
EntityOwneroperator= (EntityOwner &&handle) noexcept=default
 
- Public Member Functions inherited from Nz::ObjectHandle< Entity >
 ObjectHandle ()
 Constructs a ObjectHandle object by default.
 
 ObjectHandle (Entity *object)
 Constructs a ObjectHandle object with a pointer to an object. More...
 
 ObjectHandle (const ObjectHandle &handle)
 Constructs a ObjectHandle object by assignation. More...
 
 ObjectHandle (ObjectHandle &&handle) noexcept
 Constructs a ObjectHandle object by move semantic. More...
 
 ~ObjectHandle ()
 Destructs the object and calls reset with nullptr. More...
 
Entity * GetObject () const
 Gets the underlying object. More...
 
bool IsValid () const
 Checks whether the object is valid. More...
 
void Reset (Entity *object=nullptr)
 Resets the content of the ObjectHandle with another object. More...
 
void Reset (const ObjectHandle &handle)
 Resets the content of this with another object. More...
 
void Reset (ObjectHandle &&handle) noexcept
 Resets the content of this with another object by move semantic. More...
 
ObjectHandleSwap (ObjectHandle &handle)
 Swaps the content of the two ObjectHandle. More...
 
Nz::String ToString () const
 Gives a string representation. More...
 
 operator bool () const
 Converts the ObjectHandle to bool. More...
 
 operator Entity * () const
 Dereferences the ObjectHandle. More...
 
Entity * operator-> () const
 Dereferences the ObjectHandle. More...
 
ObjectHandleoperator= (Entity *object)
 Assigns the entity into this. More...
 
ObjectHandleoperator= (const ObjectHandle &handle)
 Sets the handle of the ObjectHandle with the handle from another. More...
 
ObjectHandleoperator= (ObjectHandle &&handle) noexcept
 Moves the ObjectHandle into this. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Nz::ObjectHandle< Entity >
static const ObjectHandle InvalidHandle
 
- Protected Member Functions inherited from Nz::ObjectHandle< Entity >
void OnObjectDestroyed ()
 Action to do on object destruction.
 
void OnObjectMoved (Entity *newObject)
 Action to do on object move.
 
- Protected Attributes inherited from Nz::ObjectHandle< Entity >
Entity * m_object
 

Detailed Description

NDK class that represents the owner of the entity and so its lifetime.

Constructor & Destructor Documentation

◆ EntityOwner()

Ndk::EntityOwner::EntityOwner ( Entity entity)
inlineexplicit

Constructs a EntityOwner object.

Parameters
entityEntity to own

◆ ~EntityOwner()

Ndk::EntityOwner::~EntityOwner ( )
inline

Destructs the object and calls Reset.

See also
Reset

Member Function Documentation

◆ operator=()

EntityOwner & Ndk::EntityOwner::operator= ( Entity entity)
inline

Resets the ownership of the entity to the affected one.

Parameters
entityEntity to own

◆ Reset() [1/2]

void Ndk::EntityOwner::Reset ( Entity entity = nullptr)
inline

Resets the ownership of the entity, previous is killed.

Parameters
entityEntity to own

◆ Reset() [2/2]

void Ndk::EntityOwner::Reset ( EntityOwner &&  handle)
inline

Resets the ownership of the entity by move semantic.

Parameters
handleEntityOwner to move into this

The documentation for this class was generated from the following files: