Sdk/Entity: Add Disable shortcut
This commit is contained in:
parent
0a5cbe656f
commit
6c8b3eb319
|
|
@ -41,6 +41,7 @@ namespace Ndk
|
|||
|
||||
const EntityHandle& Clone() const;
|
||||
|
||||
inline void Disable();
|
||||
inline void Enable(bool enable = true);
|
||||
|
||||
inline BaseComponent& GetComponent(ComponentIndex index);
|
||||
|
|
|
|||
|
|
@ -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 <NDK/Entity.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
#include <Nazara/Core/StringStream.hpp>
|
||||
#include <algorithm>
|
||||
|
|
@ -27,12 +28,21 @@ namespace Ndk
|
|||
return static_cast<ComponentType&>(AddComponent(std::move(ptr)));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Disables the entity
|
||||
*
|
||||
* This is just a shortcut to Enable(false)
|
||||
*/
|
||||
inline void Entity::Disable()
|
||||
{
|
||||
Enable(false);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Enables the entity
|
||||
*
|
||||
* \param enable Should the entity be enabled
|
||||
*/
|
||||
|
||||
inline void Entity::Enable(bool enable)
|
||||
{
|
||||
if (m_enabled != enable)
|
||||
|
|
|
|||
Loading…
Reference in New Issue