FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
Loading...
Searching...
No Matches
arbitraryJsonTypes.hpp
1/*
2 * Copyright 2024 Guillaume Guillet
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _FGE_ARBITRARYJSONTYPES_HPP_INCLUDED
18#define _FGE_ARBITRARYJSONTYPES_HPP_INCLUDED
19
20#include "C_rect.hpp"
21#include "C_vector.hpp"
22#include "FastEngine/graphic/C_color.hpp"
23#include "json.hpp"
24#include "tinyutf8.h"
25
26namespace fge
27{
28
29template<class T>
30void to_json(nlohmann::json& j, fge::Rect<T> const& p);
31template<class T>
32void from_json(nlohmann::json const& j, fge::Rect<T>& p);
33
34template<class T>
35void to_json(nlohmann::json& j, fge::Vector2<T> const& p);
36template<class T>
37void from_json(nlohmann::json const& j, fge::Vector2<T>& p);
38
39template<class T>
40void to_json(nlohmann::json& j, fge::Vector3<T> const& p);
41template<class T>
42void from_json(nlohmann::json const& j, fge::Vector3<T>& p);
43
44inline void to_json(nlohmann::json& j, fge::Color const& p);
45inline void from_json(nlohmann::json const& j, fge::Color& p);
46
47} // namespace fge
48
49namespace glm
50{
51
52template<class T>
53void to_json(nlohmann::json& j, glm::vec<2, T> const& p);
54template<class T>
55void from_json(nlohmann::json const& j, glm::vec<2, T>& p);
56
57template<class T>
58void to_json(nlohmann::json& j, glm::vec<3, T> const& p);
59template<class T>
60void from_json(nlohmann::json const& j, glm::vec<3, T>& p);
61
62} // namespace glm
63
64namespace tiny_utf8
65{
66
67inline void to_json(nlohmann::json& j, tiny_utf8::string const& p);
68inline void from_json(nlohmann::json const& j, tiny_utf8::string& p);
69
70} // namespace tiny_utf8
71
72#include <FastEngine/arbitraryJsonTypes.inl>
73
74#endif // _FGE_ARBITRARYJSONTYPES_HPP_INCLUDED
Definition C_color.hpp:35
Definition C_rect.hpp:36