Looking at the examples this provides a very simple interface to enable JSON (de)serialisation without gigantic patching in liblcf. Can be even injected from the outside (in the editor code).
As JSON would be a good project format for the editor (with suggestions like "put every entity in a single file to make versioning easier") and it is really simple.
Supports JSON pointers to get view on a subtree of the JSON
It manipulates the underlying object directly so binding to QML would be quite easy as QML could just read/write by string
Is very fast (not a requirement that is important but cool to have)
Minimal example providing an incomplete Actor and Learning (skills of actor) serializer:
template <>
struct glz::meta<lcf::rpg::Learning> {
using T = lcf::rpg::Learning;
static constexpr auto value = object(
"level", &T::level,
"skill_id", &T::skill_id
);
};
template <>
struct glz::meta<lcf::rpg::Actor> {
using T = lcf::rpg::Actor;
static constexpr auto value = object(
"name", &T::name,
"character_index", &T::character_index,
"transparent", &T::transparent,
"state_ranks", &T::state_ranks,
"skills", &T::skills
);
};
Just found this JSON library here: https://github.com/stephenberry/glaze
Requires C++20 - No problem for the editor.
Looking at the examples this provides a very simple interface to enable JSON (de)serialisation without gigantic patching in liblcf. Can be even injected from the outside (in the editor code).
As JSON would be a good project format for the editor (with suggestions like "put every entity in a single file to make versioning easier") and it is really simple.
Minimal example providing an incomplete Actor and Learning (skills of actor) serializer:
For the first actor this results in
name
is incorrect because our strings are a custom class. This is fixable.