libBeatsaber/src/beatnote.cpp

30 lines
672 B
C++
Raw Permalink Normal View History

2021-06-04 13:15:13 +02:00
#include "beatnoteimpl.h"
#include <nlohmann/json.hpp>
namespace Beatsaber {
void from_json(const json& j, Note& n) {
2021-06-04 14:53:31 +02:00
n.time = j.value("_time", 0);
n.line = j.value("_lineIndex", 0);
n.layer = j.value("_lineLayer", 0);
n.type = j.value("_type", 0);
n.cutdir = j.value("_cutDirection", 0);
if(j.contains("_customData")) {
n.customdata = j["_customData"].dump();
}
}
void from_json(const json& j, Wall& w) {
w.time = j.value("_time", 0);
w.line = j.value("_lineIndex", 0);
w.type = j.value("_type", 0);
w.duration = j.value("_duration", 0);
w.width = j.value("_width", 1);
if(j.contains("_customData")) {
w.customdata = j["_customData"].dump();
}
2021-06-04 13:15:13 +02:00
}
}