28 #include <type_traits> 29 #include <ht_transform.h> 31 #include <ht_jsonhelper.h> 40 using JSON = Core::JSON;
51 static Core::Guid GetComponentId(
void);
60 virtual Core::JSON VSerialize(
void) = 0;
61 virtual bool VDeserialize(
const Core::JSON& jsonObject) = 0;
74 bool GetEnabled(
void);
80 void SetEnabled(
bool value);
86 virtual void VOnInit(
void) = 0;
92 virtual void VOnUpdate(
void) = 0;
100 virtual void VOnDestroy(
void) = 0;
106 virtual Component* VClone(
void)
const = 0;
108 virtual Core::Guid VGetComponentId(
void)
const = 0;
121 virtual void VOnEnabled(
void) = 0;
128 virtual void VOnDisabled(
void) = 0;
130 bool m_enabled{
true};
134 template <
typename T>
137 static_assert(std::is_base_of<Component, T>::value && !std::is_same<Component, T>::value,
"Must be a sub-class of Hatchit::Game::Component!");
138 static Core::Guid
id = Core::Guid();
Definition: ht_component.h:42
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_glfwkeyboard.h:21
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_gameobject.h:48
static Core::Guid GetComponentId(void)
Returns the unique id associated with a Component of type T.
Definition: ht_component.h:135
GameObject * m_owner
The GameObject to which this Component is attached.
Definition: ht_component.h:131