(Entity) Added non-template version of components handling

Former-commit-id: 0f9795a0b130e6e5ebb26782459d79bde1b0efa1
This commit is contained in:
Lynix
2015-03-01 13:42:17 +01:00
parent 7c73407fa4
commit c71c050831
2 changed files with 47 additions and 37 deletions

View File

@@ -8,7 +8,7 @@
#define NDK_ENTITY_HPP
#include <NDK/Prerequesites.hpp>
#include <NDK/BaseComponent.hpp>
#include <NDK/Component.hpp>
#include <memory>
#include <vector>
@@ -29,15 +29,17 @@ namespace Ndk
Entity(Entity&& entity);
~Entity();
BaseComponent& AddComponent(std::unique_ptr<BaseComponent>&& component);
template<typename ComponentType, typename... Args> ComponentType& AddComponent(Args&&... args);
EntityHandle CreateHandle();
BaseComponent& GetComponent(nzUInt32 componentId);
template<typename ComponentType> ComponentType& GetComponent();
template<typename ComponentType> const ComponentType& GetComponent() const;
Id GetId() const;
World* GetWorld() const;
bool HasComponent(nzUInt32 componentId) const;
template<typename ComponentType> bool HasComponent() const;
void Kill();
@@ -45,6 +47,7 @@ namespace Ndk
bool IsValid() const;
void RemoveAllComponent();
void RemoveComponent(nzUInt32 componentId);
template<typename ComponentType> void RemoveComponent();
Entity& operator=(const Entity&) = delete;