|
Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
|
Singleton registry managing callbacks for component serialization and deserialization. More...
#include <ComponentSerializerRegistry.hpp>
Classes | |
| struct | Registration |
| Links a component name to its serialization and deserialization functions. More... | |
Public Types | |
| using | SerializerCallback = std::function<void(Registry& registry, Entity entity, std::ostream& out, int indentLevel)> |
| Signature for component serialization callbacks. | |
| using | DeserializerCallback = std::function<void(Registry& registry, VulkanRenderer& renderer, Entity entity, const std::string& entityJson)> |
| Signature for component deserialization callbacks. | |
Public Member Functions | |
| void | registerComponent (const std::string &componentName, SerializerCallback serialize, DeserializerCallback deserialize) |
| Registers serializer callbacks for a component type. | |
| const std::vector< Registration > & | getRegistrations () const |
| Retrieves all registered components. | |
Static Public Member Functions | |
| static ComponentSerializerRegistry & | getInstance () |
| Retrieves singleton instance of the registry. | |
Private Member Functions | |
| ComponentSerializerRegistry ()=default | |
| Default constructor for singleton. | |
Private Attributes | |
| std::vector< Registration > | registrations |
| Array of registered components. | |
Singleton registry managing callbacks for component serialization and deserialization.
| using ComponentSerializerRegistry::DeserializerCallback = std::function<void(Registry& registry, VulkanRenderer& renderer, Entity entity, const std::string& entityJson)> |
Signature for component deserialization callbacks.
| using ComponentSerializerRegistry::SerializerCallback = std::function<void(Registry& registry, Entity entity, std::ostream& out, int indentLevel)> |
Signature for component serialization callbacks.
|
privatedefault |
Default constructor for singleton.
|
static |
Retrieves singleton instance of the registry.
|
inline |
Retrieves all registered components.
|
inline |
Registers serializer callbacks for a component type.
| componentName | Name of component. |
| serialize | Serialization callback. |
| deserialize | Deserialization callback. |
|
private |
Array of registered components.