#include "config.h" // Save Setting to json file bool SceneManager::SaveJson() { using namespace nlohmann; json j; j["Name"] = "DK Flappy Bird!"; j["SoundVolume"] = volume; j["bLog"] = isLog; // write prettified JSON to another file std::ofstream o("settings.json"); if (o.bad()) { return false; } o << std::setw(4) << j << std::endl; o.close(); return true; } bool SceneManager::LoadJson() { using namespace nlohmann; std::ifstream f("settings.json"); if (f.bad()) { return false; } json data = json::parse(f); volume = data["SoundVolume"]; isLog = data["bLog"]; f.close(); return true; }