You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <>
structglz::meta<lcf::rpg::Learning> {
using T = lcf::rpg::Learning;
staticconstexprauto value = object(
"level", &T::level,
"skill_id", &T::skill_id
);
};
template <>
structglz::meta<lcf::rpg::Actor> {
using T = lcf::rpg::Actor;
staticconstexprauto 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.The text was updated successfully, but these errors were encountered: