76#define AUTO_REGISTER_COMPONENT(ComponentType) \
78 struct ComponentRegistrar_##ComponentType { \
79 ComponentRegistrar_##ComponentType(); \
81 static ComponentRegistrar_##ComponentType g_registrar_##ComponentType; \
83 inline ComponentRegistrar_##ComponentType::ComponentRegistrar_##ComponentType() { \
84 extern void RegisterComponentFactory_Internal(const char*, std::function<bool(EntityID, const ComponentDefinition&)>); \
85 RegisterComponentFactory_Internal( \
87 [](EntityID entity, const ComponentDefinition& def) { \
88 return InstantiateComponentGeneric<ComponentType>(entity, def); \
bool InstantiateComponentGeneric(EntityID entity, const ComponentDefinition &def)
Generic template function for instantiating any ECS component This handles the common case: create co...
ComponentTypeID GetComponentTypeID_Static()
World and ECS Manager for Olympe Engine.
Factory class for creating entities from prefab blueprints.
static World & Get()
Get singleton instance (short form)
T & AddComponent(EntityID entity, Args &&... args)
T & GetComponent(EntityID entity)