summaryrefslogtreecommitdiffhomepage
path: root/serialize/wall-atlas.hpp
blob: 16c43ab6166059436fe79b2350a9f6aa3757f2dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once
#include "src/wall-atlas.hpp"
#include <memory>
#include <nlohmann/json_fwd.hpp>

namespace nlohmann {

template<>
struct adl_serializer<std::shared_ptr<floormat::wall_atlas>>
{
    static void to_json(json& j, const std::shared_ptr<const floormat::wall_atlas>& x);
    static void from_json(const json& j, std::shared_ptr<floormat::wall_atlas>& x);
};

} // namespace nlohmann

namespace floormat::Wall::detail {

uint8_t direction_index_from_name(StringView s);
StringView direction_index_to_name(size_t i);
[[nodiscard]] Group read_group_metadata(const nlohmann::json& jgroup);
[[nodiscard]] Direction read_direction_metadata(const nlohmann::json& jroot, Direction_ dir);
Info read_info_header(const nlohmann::json& jroot);

void write_group_metadata(nlohmann::json& jgroup, const Group& val);

} // namespace floormat::Wall::detail