23 j = nlohmann::json{{
"x", p._x}, {
"y", p._y}, {
"w", p._width}, {
"h", p._height}};
28 j.at(
"x").get_to(p._x);
29 j.at(
"y").get_to(p._y);
30 j.at(
"w").get_to(p._width);
31 j.at(
"h").get_to(p._height);
35void to_json(nlohmann::json& j, fge::Vector2<T>
const& p)
37 j = nlohmann::json{{
"x", p.x}, {
"y", p.y}};
40void from_json(nlohmann::json
const& j, fge::Vector2<T>& p)
42 j.at(
"x").get_to(p.x);
43 j.at(
"y").get_to(p.y);
47void to_json(nlohmann::json& j, fge::Vector3<T>
const& p)
49 j = nlohmann::json{{
"x", p.x}, {
"y", p.y}, {
"z", p.z}};
52void from_json(nlohmann::json
const& j, fge::Vector3<T>& p)
54 j.at(
"x").get_to(p.x);
55 j.at(
"y").get_to(p.y);
56 j.at(
"z").get_to(p.z);
59inline void to_json(nlohmann::json& j,
fge::Color const& p)
63inline void from_json(nlohmann::json
const& j,
fge::Color& p)
76void to_json(nlohmann::json& j, glm::vec<2, T>
const& p)
78 j = nlohmann::json{{
"x", p.x}, {
"y", p.y}};
81void from_json(nlohmann::json
const& j, glm::vec<2, T>& p)
83 j.at(
"x").get_to(p.x);
84 j.at(
"y").get_to(p.y);
88void to_json(nlohmann::json& j, glm::vec<3, T>
const& p)
90 j = nlohmann::json{{
"x", p.x}, {
"y", p.y}, {
"z", p.z}};
93void from_json(nlohmann::json
const& j, glm::vec<3, T>& p)
95 j.at(
"x").get_to(p.x);
96 j.at(
"y").get_to(p.y);
97 j.at(
"z").get_to(p.z);
105inline void to_json(nlohmann::json& j, tiny_utf8::string
const& p)
109inline void from_json(nlohmann::json
const& j, tiny_utf8::string& p)
113 p = tiny_utf8::string{std::move(str)};
Definition C_color.hpp:35