mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
reduce extra includes
This commit is contained in:
parent
dbe9ca5efe
commit
b3feb5945b
25 changed files with 71 additions and 46 deletions
27
src/world/Weather.cpp
Normal file
27
src/world/Weather.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include "Weather.hpp"
|
||||
|
||||
#include "data/dv.hpp"
|
||||
|
||||
dv::value Weather::serialize() const {
|
||||
return dv::object({
|
||||
{"a", a.serialize()},
|
||||
{"b", b.serialize()},
|
||||
{"name-a", nameA},
|
||||
{"name-b", nameB},
|
||||
{"t", t},
|
||||
{"speed", speed},
|
||||
});
|
||||
}
|
||||
|
||||
void Weather::deserialize(const dv::value& src) {
|
||||
if (src.has("a")) {
|
||||
a.deserialize(src["a"]);
|
||||
}
|
||||
if (src.has("b")) {
|
||||
b.deserialize(src["b"]);
|
||||
}
|
||||
src.at("name-a").get(nameA);
|
||||
src.at("name-b").get(nameB);
|
||||
src.at("t").get(t);
|
||||
src.at("speed").get(speed);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue