diff options
Diffstat (limited to 'serialize/scenery.hpp')
| -rw-r--r-- | serialize/scenery.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/serialize/scenery.hpp b/serialize/scenery.hpp new file mode 100644 index 00000000..e7946913 --- /dev/null +++ b/serialize/scenery.hpp @@ -0,0 +1,31 @@ +#pragma once +#include "src/scenery.hpp" +#include <Corrade/Containers/StringView.h> +#include <vector> +#include <nlohmann/json_fwd.hpp> + +namespace nlohmann { + +template<> struct adl_serializer<floormat::scenery_type> { + static void to_json(json& j, floormat::scenery_type val); + static void from_json(const json& j, floormat::scenery_type& val); +}; + +template<> struct adl_serializer<floormat::rotation> { + static void to_json(json& j, floormat::rotation val); + static void from_json(const json& j, floormat::rotation& val); +}; + +template<> struct adl_serializer<floormat::scenery_proto> { + static void to_json(json& j, const floormat::scenery_proto& val); + static void from_json(const json& j, floormat::scenery_proto& val); + + struct item { + Corrade::Containers::StringView name, description; + floormat::scenery_proto proto; + }; + + static std::vector<item> deserialize_list(Corrade::Containers::StringView file); +}; + +} // namespace nlohmann |
