Sdk/EntityOwner: Prevent copy (Copying an EntityOwner has no use)

Former-commit-id: 628eb865509a84de19bf97bf8253960d6bfb0005
This commit is contained in:
Lynix 2016-01-19 12:20:38 +01:00
parent e907db7de1
commit 2b85c93433
2 changed files with 3 additions and 20 deletions

View File

@ -16,16 +16,15 @@ namespace Ndk
public:
EntityOwner() = default;
explicit EntityOwner(Entity* entity);
EntityOwner(const EntityOwner& handle);
EntityOwner(const EntityOwner& handle) = delete;
EntityOwner(EntityOwner&& handle);
~EntityOwner();
void Reset(Entity* entity = nullptr);
void Reset(const EntityOwner& handle);
void Reset(EntityOwner&& handle);
EntityOwner& operator=(Entity* entity);
EntityOwner& operator=(const EntityOwner& handle);
EntityOwner& operator=(const EntityOwner& handle) = delete;
EntityOwner& operator=(EntityOwner&& handle);
};
}

View File

@ -14,11 +14,6 @@ namespace Ndk
Reset(entity);
}
inline EntityOwner::EntityOwner(const EntityOwner& handle) :
EntityHandle(handle)
{
}
inline EntityOwner::EntityOwner(EntityOwner&& handle) :
EntityHandle(std::move(handle))
{
@ -37,14 +32,10 @@ namespace Ndk
EntityHandle::Reset(entity);
}
inline void EntityOwner::Reset(const EntityOwner& handle)
{
Reset(handle.GetEntity());
}
inline void EntityOwner::Reset(EntityOwner&& handle)
{
Reset(handle.GetEntity());
handle.m_entity = nullptr;
}
inline EntityOwner& EntityOwner::operator=(Entity* entity)
@ -54,13 +45,6 @@ namespace Ndk
return *this;
}
inline EntityOwner& EntityOwner::operator=(const EntityOwner& handle)
{
Reset(handle);
return *this;
}
inline EntityOwner& EntityOwner::operator=(EntityOwner&& handle)
{
Reset(std::move(handle));