2022-11-15 12:19:11 +01:00
|
|
|
#pragma once
|
|
|
|
|
#include <entt/entt.hpp>
|
|
|
|
|
#include "MinimalEngine.h"
|
|
|
|
|
#include "Scene/Scene.h"
|
|
|
|
|
namespace Seele
|
|
|
|
|
{
|
|
|
|
|
// An entity describes a part of a scene
|
|
|
|
|
// It is just a wrapper the ID of a registry
|
|
|
|
|
class Entity
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Entity(PScene scene);
|
|
|
|
|
virtual ~Entity();
|
|
|
|
|
|
|
|
|
|
template<typename Component, typename... Args>
|
2022-11-30 10:19:45 +01:00
|
|
|
Component& attachComponent(Args... args)
|
2022-11-15 12:19:11 +01:00
|
|
|
{
|
2022-11-30 10:19:45 +01:00
|
|
|
return scene->attachComponent<Component>(identifier, args...);
|
2022-11-15 12:19:11 +01:00
|
|
|
}
|
|
|
|
|
protected:
|
|
|
|
|
PScene scene;
|
|
|
|
|
entt::entity identifier;
|
|
|
|
|
};
|
|
|
|
|
DEFINE_REF(Entity)
|
|
|
|
|
} // namespace Seele
|