ECS with entt
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#ifndef NATIVE_SCRIPTABLE_ENTITY_HPP
|
||||
#define NATIVE_SCRIPTABLE_ENTITY_HPP
|
||||
|
||||
#include "open_engine/scene/entity.hpp"
|
||||
|
||||
namespace OpenEngine {
|
||||
|
||||
class NativeScriptableEntity
|
||||
{
|
||||
public:
|
||||
virtual ~NativeScriptableEntity() = default;
|
||||
template <typename T>
|
||||
T& GetComponent() { return entity.GetComponents<T>(); };
|
||||
|
||||
protected:
|
||||
virtual void OnCreate() {};
|
||||
virtual void OnUpdate() {};
|
||||
virtual void OnDestroy() {};
|
||||
|
||||
private:
|
||||
Entity entity;
|
||||
|
||||
friend class Scene;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // NATIVE_SCRIPTABLE_ENTITY_HPP
|
||||
Reference in New Issue
Block a user