(Entity) Inlined most code

Former-commit-id: 287c7c557263497ba89451dd2d640fcd8522ef3a
This commit is contained in:
Lynix
2015-02-08 17:39:06 +01:00
parent 5fb728d0be
commit d5a8bdca12
3 changed files with 54 additions and 41 deletions

View File

@@ -5,45 +5,13 @@
namespace Ndk
{
Entity::Entity() :
m_world(nullptr)
{
m_id.value = 0;
}
Entity::Entity(Id id, World* world) :
m_id(id),
m_world(world)
{
}
void Entity::Kill()
{
m_world->KillEntity(*this);
}
Entity::Id Entity::GetId() const
{
return m_id;
}
World* Entity::GetWorld() const
{
return m_world;
}
bool Entity::IsValid() const
{
return m_world != nullptr && m_world->IsEntityIdValid(m_id);
}
bool Entity::operator==(const Entity& other) const
{
return m_world == other.m_world && m_id == other.m_id;
}
bool Entity::operator!=(const Entity& other) const
{
return !operator==(other);
}
}