#pragma once #include "copium/ecs/Config.h" #include "copium/ecs/ECSManager.h" namespace Copium { class Entity { friend class ECSManager; private: ECSManager* manager; EntityId id; public: Entity(); Entity(ECSManager* manager); Entity(ECSManager* manager, EntityId id); operator EntityId() const; void operator=(EntityId entityId); bool operator==(const Entity& entity); bool operator!=(const Entity& entity); operator bool() const; void Invalidate(); void Destroy(); void SetId(EntityId entityId); EntityId GetId() const; ECSManager* GetManager() const; static Entity Create(ECSManager* manager); template inline Component& AddComponent(Args... args) { return manager->AddComponent(id, args...); } template std::tuple AddComponents(Components&&... components) { return manager->AddComponents(id, components...); } template inline void RemoveComponent() { return manager->RemoveComponent(id); } template inline void RemoveComponents() { return manager->RemoveComponents(id); } template inline Component& GetComponent() const { return manager->GetComponent(id); } template inline bool HasComponent() const { return manager->HasComponent(id); } template inline bool HasComponents() const { return manager->HasComponents(id); } template inline bool HasAnyComponent() const { return manager->HasAnyComponent(id); } }; }