#include "src/tile-atlas.hpp" #include "serialize/tile-atlas.hpp" #include "serialize/corrade-string.hpp" #include "serialize/magnum-vector2i.hpp" #include "loader.hpp" #include #include using namespace floormat; namespace nlohmann { void adl_serializer>::to_json(json& j, const std::shared_ptr& x) { using nlohmann::to_json; if (!x) j = nullptr; else to_json(j, std::tuple{x->name(), x->num_tiles2()}); } void adl_serializer>::from_json(const json& j, std::shared_ptr& x) { if (j.is_null()) x = nullptr; else { std::tuple proxy = j; const auto& [name, num_tiles] = proxy; x = loader.tile_atlas(name, num_tiles); } } } // namespace nlohmann