Added Components

Former-commit-id: 02f9e9892b58a725697b83e7b75127db5b3a27f4
This commit is contained in:
Lynix
2015-03-01 01:53:49 +01:00
parent dd56dd6e29
commit 699b580516
7 changed files with 205 additions and 0 deletions

View File

@@ -8,6 +8,8 @@
#define NDK_ENTITY_HPP
#include <NDK/Prerequesites.hpp>
#include <NDK/BaseComponent.hpp>
#include <memory>
#include <vector>
namespace Ndk
@@ -27,15 +29,24 @@ namespace Ndk
Entity(Entity&& entity);
~Entity();
template<typename Component, typename... Args> Component& AddComponent(Args&&... args);
EntityHandle CreateHandle();
template<typename Component> Component& GetComponent();
template<typename Component> const Component& GetComponent() const;
Id GetId() const;
World* GetWorld() const;
template<typename Component> bool HasComponent() const;
void Kill();
bool IsValid() const;
void RemoveAllComponent();
template<typename Component> void RemoveComponent();
Entity& operator=(const Entity&) = delete;
Entity& operator=(Entity&&) = delete;
@@ -48,6 +59,7 @@ namespace Ndk
void RegisterHandle(EntityHandle* handle);
void UnregisterHandle(EntityHandle* handle);
std::vector<std::unique_ptr<BaseComponent>> m_components;
std::vector<EntityHandle*> m_handles;
Id m_id;
World* m_world;