diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-08 08:38:04 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-08 08:38:04 +0100 |
commit | 5aeb836bbf71fcb1641d63e940282049d54d6fa5 (patch) | |
tree | 0abf1111ea43831ab4cbe20935d5881200460020 /serialize/wall-atlas.cpp | |
parent | bfefeca5d59f26fb2b7b605d9dc7dbdead1a8ec4 (diff) |
a
Diffstat (limited to 'serialize/wall-atlas.cpp')
-rw-r--r-- | serialize/wall-atlas.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/serialize/wall-atlas.cpp b/serialize/wall-atlas.cpp index e2e6eee8..11ace967 100644 --- a/serialize/wall-atlas.cpp +++ b/serialize/wall-atlas.cpp @@ -101,22 +101,6 @@ Info read_info_header(const json& jroot) return val; } -void write_direction_metadata(json& jroot, const Direction& dir, Direction_ i) -{ - auto name = std::string_view{direction_index_to_name((size_t)i)}; - auto j = json{json::value_t::object}; - fm_assert(!jroot.contains(name)); - - for (auto [s_, memfn, tag] : Direction::members) - { - std::string_view s = s_; - const auto& group = dir.*memfn; - write_group_metadata(j[s], group); - } - - jroot[name] = std::move(j); -} - void write_group_metadata(json& jgroup, const Group& val) { fm_assert(jgroup.is_object()); @@ -132,6 +116,18 @@ void write_group_metadata(json& jgroup, const Group& val) jgroup["default-tint"s] = val.default_tint; } +void write_direction_metadata(json& jdir, const Direction& dir) +{ + //auto name = std::string_view{direction_index_to_name((size_t)i)}; + + for (auto [s_, memfn, tag] : Direction::members) + { + std::string_view s = s_; + const auto& group = dir.*memfn; + write_group_metadata(jdir[s], group); + } +} + void write_info_header(json& jroot, const Info& info) { jroot["name"s] = info.name; |