diff --git a/SDK/include/NDK/EntityHandle.hpp b/SDK/include/NDK/EntityHandle.hpp index 21d3f3820..554bd4a35 100644 --- a/SDK/include/NDK/EntityHandle.hpp +++ b/SDK/include/NDK/EntityHandle.hpp @@ -33,6 +33,8 @@ namespace Ndk EntityHandle& Swap(EntityHandle& handle); + NzString ToString() const; + operator bool() const; operator Entity*() const; Entity* operator->() const; diff --git a/SDK/include/NDK/EntityHandle.inl b/SDK/include/NDK/EntityHandle.inl index fa2a55469..e34bc8492 100644 --- a/SDK/include/NDK/EntityHandle.inl +++ b/SDK/include/NDK/EntityHandle.inl @@ -2,6 +2,7 @@ // This file is part of the "Nazara Development Kit" // For conditions of distribution and use, see copyright notice in Prerequesites.hpp +#include #include #include @@ -89,6 +90,20 @@ namespace Ndk return *this; } + inline NzString EntityHandle::ToString() const + { + NzStringStream ss; + ss << "EntityHandle("; + if (IsValid()) + ss << "Entity(" << m_entity->GetId() << ')'; + else + ss << "Null entity"; + + ss << ')'; + + return ss; + } + inline EntityHandle::operator bool() const { return IsValid(); @@ -143,7 +158,7 @@ namespace Ndk { out << "EntityHandle("; if (handle.IsValid()) - out << "Entity(" << handle->GetId() << ")"; + out << "Entity(" << handle->GetId() << ')'; else out << "Null entity";