#pragma once #include "magnum-vector2i.hpp" #include #include namespace nlohmann { template struct adl_serializer> { using vec = Magnum::Math::Vector; static void to_json(json& j, const vec& val); static void from_json(const json& j, vec& val); }; template void adl_serializer>::to_json(json& j, const vec& val) { std::array array{}; for (auto i = 0uz; i < N; i++) array[i] = val[i]; using nlohmann::to_json; to_json(j, array); } template void adl_serializer>::from_json(const json& j, vec& val) { std::array array{}; using nlohmann::from_json; from_json(j, array); for (auto i = 0uz; i < N; i++) val[i] = array[i]; } template struct adl_serializer> : adl_serializer> {}; template struct adl_serializer> : adl_serializer> {}; template struct adl_serializer> : adl_serializer> {}; template struct adl_serializer> : adl_serializer> {}; template struct adl_serializer> : adl_serializer> {}; } // namespace nlohmann