52 if (existing.componentName == componentName) {
53 existing.serialize = serialize;
54 existing.deserialize = deserialize;
58 registrations.push_back({ componentName, serialize, deserialize });
#define ENGINE_API
Definition EngineAPI.hpp:10
std::function< void(Registry ®istry, Entity entity, std::ostream &out, int indentLevel)> SerializerCallback
Signature for component serialization callbacks.
Definition ComponentSerializerRegistry.hpp:21
static ComponentSerializerRegistry & getInstance()
Retrieves singleton instance of the registry.
Definition ComponentSerializerRegistry.cpp:3
ComponentSerializerRegistry()=default
Default constructor for singleton.
void registerComponent(const std::string &componentName, SerializerCallback serialize, DeserializerCallback deserialize)
Registers serializer callbacks for a component type.
Definition ComponentSerializerRegistry.hpp:50
const std::vector< Registration > & getRegistrations() const
Retrieves all registered components.
Definition ComponentSerializerRegistry.hpp:66
std::function< void(Registry ®istry, VulkanRenderer &renderer, Entity entity, const std::string &entityJson)> DeserializerCallback
Signature for component deserialization callbacks.
Definition ComponentSerializerRegistry.hpp:23
std::vector< Registration > registrations
Array of registered components.
Definition ComponentSerializerRegistry.hpp:74
Lightweight identifier representing a game object in the Entity Component System.
Definition Entity.hpp:11
Coordinates entities and components, providing creation, removal, lookup, and views.
Definition Registry.hpp:30
Manages core Vulkan pipeline states, device interaction, frames, buffers, and command submissions.
Definition VulkanRenderer.hpp:127
Links a component name to its serialization and deserialization functions.
Definition ComponentSerializerRegistry.hpp:29
DeserializerCallback deserialize
Function to deserialize the component.
Definition ComponentSerializerRegistry.hpp:35
std::string componentName
String identifier of the component type.
Definition ComponentSerializerRegistry.hpp:31
SerializerCallback serialize
Function to serialize the component.
Definition ComponentSerializerRegistry.hpp:33