(NDK) First commit

-Still missing a build file
-This is an Entity Component System, without any component nor system,
so this is an Entity. Yay.


Former-commit-id: f04d2fdfe8819826f940469c2618140a26afa637
This commit is contained in:
Lynix
2015-02-06 13:56:27 +01:00
parent d6c08db282
commit 5067767074
5 changed files with 345 additions and 0 deletions

49
SDK/src/NDK/Entity.cpp Normal file
View File

@@ -0,0 +1,49 @@
// This file was automatically generated on 26 May 2014 at 01:05:31
#include <NDK/Entity.hpp>
#include <NDK/World.hpp>
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);
}
}