32 lines
715 B
C++
32 lines
715 B
C++
// Copyright (c) 2022 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#include "SaveFile.hpp"
|
|
|
|
using namespace Dawn;
|
|
|
|
bool_t SaveFile::has(std::string key) {
|
|
auto exist = this->values.find(key);
|
|
return exist != this->values.end();
|
|
}
|
|
|
|
savedata_t SaveFile::get(std::string key) {
|
|
auto exist = this->values.find(key);
|
|
assertTrue(exist != this->values.end());
|
|
return exist->second;
|
|
}
|
|
|
|
void SaveFile::set(std::string key, savedata_t value) {
|
|
this->hasChanges = true;
|
|
this->values[key] = value;
|
|
}
|
|
|
|
void SaveFile::copy(struct SaveFile raw, std::string key) {
|
|
this->set(key, raw.get(key));
|
|
}
|
|
|
|
void SaveFile::reset() {
|
|
this->values.clear();
|
|
} |