-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBinaryObject.cpp
More file actions
35 lines (31 loc) · 910 Bytes
/
Copy pathBinaryObject.cpp
File metadata and controls
35 lines (31 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "BinaryObject.h"
namespace sh::game
{
SH_GAME_API auto BinaryObject::Serialize() const -> core::Json
{
core::Json json = Super::Serialize();
json["BinaryObject"]["data"] = data;
return json;
}
SH_GAME_API void BinaryObject::Deserialize(const core::Json& json)
{
Super::Deserialize(json);
auto it = json.find("BinaryObject");
if (it != json.end())
{
it = it->find("data");
if (it != json.end())
data = json.get<std::vector<uint8_t>>();
}
}
SH_GAME_API auto BinaryObject::operator=(const BinaryObject& other) -> BinaryObject&
{
data = other.data;
return *this;
}
SH_GAME_API auto BinaryObject::operator=(BinaryObject&& other) noexcept -> BinaryObject&
{
data = std::move(other.data);
return *this;
}
}//namespace