Loading...
Searching...
No Matches
5#ifndef CSENGINE_APP_COMPONENTDEF_H
6#define CSENGINE_APP_COMPONENTDEF_H
8#define Transform static_cast<TransformInterface*>(gameObject->GetTransform())
9#define COMPONENT_DECLARE(CLASSNAME) \
11auto GetComponent() override
13#define COMPONENT_DEFINE_CONSTRUCTOR(CLASSNAME) \
14explicit CLASSNAME(CSE::SGameObject* l_gameObject)
16#define COMPONENT_CONSTRUCTOR(CLASSNAME) \
17CLASSNAME::CLASSNAME(CSE::SGameObject* l_gameObject) : CSE::SComponent(#CLASSNAME, l_gameObject)
19#define FIND_OBJ_REFERENCE(obj, src) \
21 auto targetObject = lists_obj.find(src->obj); \
22 obj = (targetObject != lists_obj.end()) ? targetObject->second : src->obj; \
24#define FIND_COMP_REFERENCE(comp, src, componentName) \
26 auto targetObject = lists_comp.find(src->comp); \
27 comp = (targetObject != lists_comp.end()) ? static_cast<componentName*>(targetObject->second) : src->comp; \
30#define INIT_COMPONENT_CLONE(className, cloneName) \
31className* cloneName = nullptr; \
32if (object == nullptr) { \
33cloneName = new className(object); \
35cloneName = object->CreateComponent<className>(); \