mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
make BlockMaterial serializable
This commit is contained in:
parent
862ac496a8
commit
9e28b783fd
4 changed files with 26 additions and 9 deletions
|
|
@ -8,7 +8,7 @@
|
|||
#include "presets/ParticlesPreset.hpp"
|
||||
#include "util/stringutil.hpp"
|
||||
|
||||
dv::value BlockMaterial::serialize() const {
|
||||
dv::value BlockMaterial::toTable() const {
|
||||
return dv::object({
|
||||
{"name", name},
|
||||
{"stepsSound", stepsSound},
|
||||
|
|
@ -18,6 +18,24 @@ dv::value BlockMaterial::serialize() const {
|
|||
});
|
||||
}
|
||||
|
||||
dv::value BlockMaterial::serialize() const {
|
||||
return dv::object({
|
||||
{"name", name},
|
||||
{"steps-sound", stepsSound},
|
||||
{"place-sound", placeSound},
|
||||
{"break-sound", breakSound},
|
||||
{"hit-sound", hitSound}
|
||||
});
|
||||
}
|
||||
|
||||
void BlockMaterial::deserialize(const dv::value& src) {
|
||||
src.at("name").get(name);
|
||||
src.at("steps-sound").get(stepsSound);
|
||||
src.at("place-sound").get(placeSound);
|
||||
src.at("break-sound").get(breakSound);
|
||||
src.at("hit-sound").get(hitSound);
|
||||
}
|
||||
|
||||
CoordSystem::CoordSystem(glm::ivec3 axisX, glm::ivec3 axisY, glm::ivec3 axisZ)
|
||||
: axes({axisX, axisY, axisZ}) {
|
||||
fix = glm::ivec3(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue