![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Include dependency graph for ComponentRegistry.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Macros | |
| #define | AUTO_REGISTER_COMPONENT(ComponentType) |
| Macro for auto-registering a component at program startup Place this immediately after the struct definition. | |
Functions | |
| template<typename T > | |
| bool | InstantiateComponentGeneric (EntityID entity, const ComponentDefinition &def) |
| Generic template function for instantiating any ECS component This handles the common case: create component if missing, get reference Specialized behavior can still use custom InstantiateXYZ() functions. | |
| #define AUTO_REGISTER_COMPONENT | ( | ComponentType | ) |
Macro for auto-registering a component at program startup Place this immediately after the struct definition.
Example: struct Position_data { Vector position; }; AUTO_REGISTER_COMPONENT(Position_data);
This creates a static dummy variable whose constructor executes before main()
Definition at line 76 of file ComponentRegistry.h.
| bool InstantiateComponentGeneric | ( | EntityID | entity, |
| const ComponentDefinition & | def | ||
| ) |
Generic template function for instantiating any ECS component This handles the common case: create component if missing, get reference Specialized behavior can still use custom InstantiateXYZ() functions.
Definition at line 47 of file ComponentRegistry.h.
References World::AddComponent(), World::Get(), World::GetComponent(), and GetComponentTypeID_Static().
Here is the call graph for this function: