feat: add new fancy reflection

This commit is contained in:
2026-11-01 23:12:00 +01:00
parent 08acd84404
commit 6a85d17899
58 changed files with 380 additions and 1055 deletions
+4 -15
View File
@@ -2,6 +2,8 @@
#include "spdlog/spdlog.h"
#include <destrum/Serialization/Reflect.h>
PrintComponent::PrintComponent(GameObject& parent) : Component(parent, "PrintComponent")
{
}
@@ -15,20 +17,7 @@ void PrintComponent::Update(float dt)
spdlog::debug(m_message);
}
void PrintComponent::ImGuiInspector()
void PrintComponent::Reflect(FieldVisitor& v)
{
Component::ImGuiInspector();
}
nlohmann::json PrintComponent::Serialize() const
{
return {{"message", m_message}};
}
void PrintComponent::Deserialize(const nlohmann::json& basic_jsons)
{
if (basic_jsons.contains("message"))
{
m_message = basic_jsons.at("message").get<std::string>();
}
v.Field("message", m_message);
}