aegis.cpp
Main Page
Related Pages
Classes
Files
File List
All
Classes
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Pages
include
aegis
gateway
objects
secret.hpp
1
//
2
// secret.hpp
3
// **********
4
//
5
// Copyright (c) 2019 Sharon W (sharon at aegis dot gg)
6
//
7
// Distributed under the MIT License. (See accompanying file LICENSE)
8
//
9
10
#pragma once
11
12
#include "aegis/config.hpp"
13
#include <nlohmann/json.hpp>
14
15
namespace
aegis
16
{
17
18
namespace
gateway
19
{
20
21
namespace
objects
22
{
23
26
struct
secret
27
{
28
std::string join;
29
std::string spectate;
30
std::string match;
31
};
32
34
inline
void
from_json(
const
nlohmann::json& j,
secret
& m)
35
{
36
if
(j.count(
"join"
) && !j[
"join"
].is_null())
37
m.join = j[
"join"
].get<std::string>();
38
if
(j.count(
"spectate"
) && !j[
"spectate"
].is_null())
39
m.spectate = j[
"spectate"
].get<std::string>();
40
if
(j.count(
"match"
) && !j[
"match"
].is_null())
41
m.match = j[
"match"
].get<std::string>();
42
}
44
46
inline
void
to_json(nlohmann::json& j,
const
secret& m)
47
{
48
if
(!m.join.empty())
49
j[
"join"
] = m.join;
50
if (!m.spectate.empty())
51
j[
"spectate"
] = m.spectate;
52
if (!m.match.empty())
53
j[
"match"
] = m.match;
54
}
56
57
}
58
59
}
60
61
}
aegis::gateway::objects::secret
Definition:
secret.hpp:26
Generated on Sun Aug 2 2020 09:17:34 for aegis.cpp by
1.8.7