ezEngine  Milestone 7
Component.h File Reference
#include <Foundation/Communication/Message.h>
#include <Foundation/Reflection/Reflection.h>
#include <Core/World/Declarations.h>
#include <Core/World/Implementation/Component_inl.h>

Go to the source code of this file.

Classes

class  ezComponent
 Base class of all component types. More...
 

Macros

#define EZ_DECLARE_COMPONENT_TYPE(componentType, managerType)
 Add this macro to a custom component type inside the type declaration. More...
 
#define EZ_BEGIN_COMPONENT_TYPE(componentType, baseType, version, managerType)
 Implements rtti and component specific functionality. Add this macro to a cpp file. More...
 
#define EZ_END_COMPONENT_TYPE   EZ_END_DYNAMIC_REFLECTED_TYPE
 Ends the component implementation code block that was opened with EZ_BEGIN_COMPONENT_TYPE.
 

Macro Definition Documentation

#define EZ_BEGIN_COMPONENT_TYPE (   componentType,
  baseType,
  version,
  managerType 
)
Value:
ezUInt16 componentType::TYPE_ID = ezComponent::GetNextTypeId(); \
ezComponentHandle componentType::GetHandle() const { return ezComponent::GetHandle<componentType>(); } \
managerType* componentType::GetManager() const { return static_cast<managerType*>(ezComponent::GetManager()); } \
EZ_BEGIN_DYNAMIC_REFLECTED_TYPE(componentType, baseType, version, ezRTTINoAllocator);

Implements rtti and component specific functionality. Add this macro to a cpp file.

See Also
EZ_BEGIN_DYNAMIC_REFLECTED_TYPE
#define EZ_DECLARE_COMPONENT_TYPE (   componentType,
  managerType 
)
Value:
EZ_ADD_DYNAMIC_REFLECTION(componentType); \
public: \
ezComponentHandle GetHandle() const; \
managerType* GetManager() const; \
EZ_FORCE_INLINE ezWorld* GetWorld() const { return GetManager()->GetWorld(); } \
virtual ezUInt16 GetTypeId() const override { return TYPE_ID; } \
static EZ_FORCE_INLINE ezUInt16 TypeId() { return TYPE_ID; } \
static ezComponentHandle CreateComponent(ezWorld* pWorld, componentType*& pComponent) { return pWorld->GetComponentManager<managerType>()->CreateComponent(pComponent); } \
private: \
friend managerType; \
static ezUInt16 TYPE_ID;

Add this macro to a custom component type inside the type declaration.