Added Components
Former-commit-id: 02f9e9892b58a725697b83e7b75127db5b3a27f4
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user